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'})
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)))
def list(index, **kwargs): for i in core.list_duplicates(index): print(i)
def test_list_empty(self): core.update_index(self.index, ['/test']) results = core.list_duplicates(self.index) self.assertEqual(0, len(list(results)))