Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
[testing] Fix linux tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Nov 9, 2018
1 parent b16a299 commit 7d5496c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/monitor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def test_str(self):
target_dir = Path('./tmp/target')
Path.mkdir(target_dir)
moni = monitor.Monitor(self.tmp_path, target_dir, False, pause=3, last_mod_time=922)
exp_result = "False | {source_dir} | {target_dir} | 3s | Stopped | False | 922".format(
source_dir=str(self.tmp_path.resolve()), target_dir=str(target_dir.resolve()))
exp_result = f"False | {self.tmp_path.resolve()} | {target_dir.resolve()} | 3s | Stopped | False | 922"

self.assertEqual(exp_result, str(moni))
self.tearDown()
Expand All @@ -51,9 +50,14 @@ def test_str(self):
source_dir = Path('./nosource')
target_dir = Path('./notarget')
moni = monitor.Monitor(source_dir, target_dir, False, pause=3, last_mod_time=922)
exp_result = "False | nosource | notarget | 3s | Source (nosource) does not exist. | False | 922"

self.assertEqual(exp_result, str(moni))
# workaround of https://bugs.python.org/issue32434
exp_result = [
f"False | {source_dir} | {target_dir} | 3s | Source ({source_dir}) does not exist. | False | 922",
f"False | {source_dir.resolve()} | {target_dir.resolve()} | 3s | Source ({source_dir.resolve()}) does not exist. | False | 922"
]

self.assertIn(str(moni), exp_result)
#self.assertEqual(exp_result, str(moni))
self.tearDown()

def test_run(self):
Expand Down

0 comments on commit 7d5496c

Please sign in to comment.