def test_it_removes_trashinfos_from_method_1_dir(self): require_empty_dir(".fake_root") make_dirs(".fake_root/media/external-disk/.Trash/") set_sticky_bit(".fake_root/media/external-disk/.Trash/") having_file(".fake_root/media/external-disk/.Trash/123/info/foo.trashinfo") empty = EmptyCmd( out=StringIO(), err=StringIO(), environ={}, getuid=lambda: 123, list_volumes=lambda: [".fake_root/media/external-disk"], ) empty.run("trash-empty") assert not os.path.exists(".fake_root/media/external-disk/.Trash/123/info/foo.trashinfo")
def make_proper_top_trash_dir(self, path): make_dirs(path) set_sticky_bit(path)