def test_touch(self): f = File(self.filename) f.touch() self.assertTrue(os.path.exists(self.filename)) self.assertEqual(f.open().read(), "") os.remove(self.filename)
def test_remove(self): f = File(self.filename) f.remove() self.assertTrue(not os.path.exists(self.filename)) # Recreate the file so that teardown doesn't raise an error. f.touch()