def test_new_outpath(self): f = OutPath() self.assertIsInstance(f, OutPath) self.assertTrue(f.is_file()) g = OutPath(dir=True) self.assertIsInstance(g, OutPath) self.assertTrue(g.is_dir())
def test_finalize(self): f = OutPath() path = str(f) self.assertTrue(os.path.isfile(path)) f._finalize() self.assertFalse(os.path.isfile(path))
def test_new_outpath_context_mgr(self): with OutPath() as f: path = str(f) self.assertIsInstance(f, OutPath) self.assertTrue(os.path.isfile(path)) self.assertFalse(os.path.isfile(path))