Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
 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())
Ejemplo n.º 3
0
 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))
Ejemplo n.º 4
0
 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))