mirror of
https://github.com/novoid/filetags.git
synced 2026-06-14 03:21:19 +00:00
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 <nbehrnd@yahoo.com>
This commit is contained in:
parent
eb2d6a25b1
commit
801dcea506
1 changed files with 7 additions and 3 deletions
|
|
@ -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'), [])
|
||||
|
|
|
|||
Loading…
Reference in a new issue