def testFile(self): with TemporaryDirectory() as tmp: fn = os.path.join(tmp, "file") with open(fn, "w") as f: f.write("data") emptyDirectory(tmp) assert os.path.exists(tmp) assert not os.path.exists(fn)
def testDir(self): with TemporaryDirectory() as tmp: d = os.path.join(tmp, "dir") os.mkdir(d) with open(os.path.join(d, "file"), "w") as f: f.write("data") emptyDirectory(tmp) assert os.path.exists(tmp) assert not os.path.exists(d)
def testNonExisting(self): emptyDirectory(self.repodir) s = self.statusCvsScm() self.assertEqual(s.flags, {ScmTaint.error}) self.assertTrue(s.error)
def testNonExisting(self): emptyDirectory(self.repodir_local) s = self.statusSvnScm() self.assertEqual(s.flags, {ScmTaint.error}) self.assertTrue(s.error)