added file_dups_immediate function

This commit is contained in:
Darko Poljak 2014-02-06 14:42:51 +01:00
parent 12df9e5a7e
commit 3cc886f057

View file

@ -3,7 +3,7 @@
# License: GPLv3 # License: GPLv3
import unittest import unittest
from sweeper import file_dups, iter_file_dups from sweeper import file_dups, iter_file_dups, file_dups_immediate
import os import os
mydir = os.path.dirname(os.path.realpath(__file__)) mydir = os.path.dirname(os.path.realpath(__file__))
@ -42,6 +42,14 @@ class TestSweeper(unittest.TestCase):
dups_exist = True dups_exist = True
self.assertTrue(dups_exist) self.assertTrue(dups_exist)
def test_file_dups_immediate_dups(self):
it = file_dups_immediate([os.path.join(mydir, 'testfiles_dups')])
dups_exist = False
for x in it:
dups_exist = True
break
self.assertTrue(dups_exist)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()