Skip to content

Commit

Permalink
use os.path.join instead of +
Browse files Browse the repository at this point in the history
  • Loading branch information
kvch committed Jul 14, 2020
1 parent 11fef2c commit 2f8d4db
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions filebeat/tests/system/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,21 +695,17 @@ def test_path_based_identity_tracking(self):
input_raw=" file_identity.path: ~",
)

testfile = self.working_dir + "/log/test.log"
testfile = os.path.join(self.working_dir, "log", "test.log")
self.__write_hello_word_to_test_input_file(testfile)

proc = self.start_beat()

# wait until the file is picked up
self.wait_until(lambda: self.log_contains("Start harvester for new file: " + testfile))
self.wait_until(lambda: self.output_has(lines=1))

renamedfile = self.working_dir + "/log/renamed.log"
renamedfile = os.path.join(self.working_dir, "log", "renamed.log")
os.rename(testfile, renamedfile)

# wait until the renamed file is picked up
self.wait_until(lambda: self.log_contains("Start harvester for new file: " + renamedfile))

# wait until the both messages are received by the output
self.wait_until(lambda: self.output_has(lines=2))
proc.check_kill_and_wait()
Expand All @@ -733,7 +729,7 @@ def test_inode_marker_based_identity_tracking(self):
input_raw=" file_identity.inode_marker.path: " + marker_location,
)

testfile = self.working_dir + "/log/test.log"
testfile = os.path.join(self.working_dir, "log", "test.log")
self.__write_hello_word_to_test_input_file(testfile)

proc = self.start_beat()
Expand Down Expand Up @@ -766,7 +762,7 @@ def test_inode_marker_based_identity_tracking_to_path_based(self):
input_raw=" file_identity.inode_marker.path: " + marker_location,
)

testfile = self.working_dir + "/log/test.log"
testfile = os.path.join(self.working_dir, "log", "test.log")
self.__write_hello_word_to_test_input_file(testfile)

proc = self.start_beat()
Expand Down

0 comments on commit 2f8d4db

Please sign in to comment.