From 801dcea506b66569b349f6c58aaa4200e0e152ef Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Mon, 23 Feb 2026 20:37:11 +0100 Subject: [PATCH] style(unit_tests.py): additional us of use os.path.join For greater portability of the test (i.e., to Windows), checks in def test_extract_tags_from_path are rekeyed. Signed-off-by: Norwid Behrnd --- tests/unit_tests.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/unit_tests.py b/tests/unit_tests.py index 9d9771d..53bf140 100755 --- a/tests/unit_tests.py +++ b/tests/unit_tests.py @@ -220,12 +220,16 @@ class TestMethods(unittest.TestCase): 'Similar tags: Simpson -> Simson simpson') def test_extract_tags_from_path(self): - self.assertEqual(set(filetags.extract_tags_from_path('/a/path/without/tags')), set([])) - self.assertEqual(set(filetags.extract_tags_from_path('/path -- ptag1/with -- ptag1 ptag2/tags')), + self.assertEqual(set(filetags.extract_tags_from_path( os.path.join (os.sep, 'a', 'path', 'without', 'tags') )), set([])) + + self.assertEqual(set(filetags.extract_tags_from_path( os.path.join(os.sep, 'path -- ptag1', 'with -- ptag1 ptag2', 'tags') )), set(['ptag1', 'ptag2'])) - self.assertEqual(set(filetags.extract_tags_from_path('/path -- ptag1/with -- ptag1 ptag2/tags -- ftag1')), + + self.assertEqual(set(filetags.extract_tags_from_path( os.path.join(os.sep, 'path -- ptag1', 'with -- ptag1 ptag2', 'tags -- ftag1') )), set(['ptag1', 'ptag2', 'ftag1'])) + + def test_extract_iso_datestamp_from_filename(self): self.assertEqual(filetags.extract_iso_datestamp_from_filename(''), []) self.assertEqual(filetags.extract_iso_datestamp_from_filename('foo'), [])