def test_dups(self): self._extract_structure() empty = os.path.join(data_dr, "empty") something = os.path.join(data_dr, "full") reusables.touch(empty) with open(something, "w") as f: f.write("stuff in here") try: dups = list(reusables.dup_finder_generator(empty, data_dr)) assert len(dups) == 1, dups dups2 = list(reusables.dup_finder_generator(something, data_dr)) assert len(dups2) == 1, dups finally: os.unlink(something) os.unlink(empty)
def test_dups(self): self._extract_structure() empty = os.path.join(data_dr, "empty") something = os.path.join(data_dr, "full") reusables.touch(empty) with open(something, "w") as f: f.write("stuff in here") try: dups = list(reusables.dup_finder(empty, data_dr)) assert len(dups) == 1, dups dups2 = list(reusables.dup_finder(something, data_dr)) assert len(dups2) == 1, dups finally: os.unlink(something) os.unlink(empty)
def test_dup_empty(self): empty_file = reusables.join_paths(test_root, "empty") reusables.touch(empty_file) self._extract_structure() b = [x for x in reusables.dup_finder(empty_file, test_root)] print(b)