added tests for iter_file_dups
This commit is contained in:
parent
63bb9779dd
commit
3ddd76fcce
1 changed files with 10 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
|||
# License: GPLv3
|
||||
|
||||
import unittest
|
||||
from sweeper import file_dups
|
||||
from sweeper import file_dups, iter_file_dups
|
||||
import os
|
||||
|
||||
mydir = os.path.dirname(os.path.realpath(__file__))
|
||||
|
@ -23,6 +23,15 @@ class TestSweeper(unittest.TestCase):
|
|||
for h, flist in dups.items():
|
||||
self.assertTrue(len(flist) == 1)
|
||||
|
||||
def test_iter_fule_dups_rethash(self):
|
||||
for item in iter_file_dups([os.path.join(mydir, 'testfiles_dups')],
|
||||
rethash=True):
|
||||
self.assertTrue(type(item).__name__ == 'tuple')
|
||||
|
||||
def test_iter_fule_dups_norethash(self):
|
||||
for item in iter_file_dups([os.path.join(mydir, 'testfiles_dups')]):
|
||||
self.assertTrue(type(item).__name__ == 'list')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in a new issue