예제 #1
0
    def test_list(self, dict_mock):
        self.fs.CreateFile('/test/file1', contents='abc')
        self.fs.CreateFile('/test/file2', contents='abc')
        self.fs.CreateFile('/test/file3', contents='abc')

        core.update_index(self.index, ['/test'])
        results = core.list_duplicates(self.index)
        self.assertSetEqual(set(results), {'/test/file2', '/test/file3'})
예제 #2
0
    def test_list_no_duplicates(self):
        self.fs.CreateFile('/test/file1', contents='abc')
        self.fs.CreateFile('/test/file3', contents='defg')
        self.fs.CreateFile('/test/file4', contents='hijk')

        core.update_index(self.index, ['/test'])
        results = core.list_duplicates(self.index)
        self.assertEqual(0, len(list(results)))
예제 #3
0
파일: commands.py 프로젝트: jleverenz/dupi
def list(index, **kwargs):
    for i in core.list_duplicates(index):
        print(i)
예제 #4
0
 def test_list_empty(self):
     core.update_index(self.index, ['/test'])
     results = core.list_duplicates(self.index)
     self.assertEqual(0, len(list(results)))