def _rm_abandoned_outputs_list(filelist): dirs = set() for path in filelist: LOGGER.info("remove abandoned output: '%s'", path) rm_f(path) dirs.add(os.path.dirname(path)) for d in dirs: rmdir_p(d)
def test_accept_pathlib(self): p = PathLib(os.path.join(self.tmpdir, "x")) touch(p) self.assertTrue(p.exists()) rm_f(p) self.assertFalse(p.exists())
def test_doesnot_file_exists(self): p = os.path.join(self.tmpdir, "x") self.assertFalse(os.path.exists(p)) rm_f(p) # nothing raised self.assertFalse(os.path.exists(p))
def test_file_exists(self): p = os.path.join(self.tmpdir, "x") touch(p) self.assertTrue(os.path.exists(p)) rm_f(p) self.assertFalse(os.path.exists(p))