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'})
Exemple #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)))
Exemple #3
0
def list(index, **kwargs):
    for i in core.list_duplicates(index):
        print(i)
Exemple #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)))