def test_move(self): f = File("hello") f.createFile() f.moveFile("newdest") self.assertTrue(f.exists()) self.assertEqual(f.getPath().path, "newdest") oldFile = File("hello") self.assertFalse(oldFile.exists()) f.removeFile() self.assertFalse(f.exists())
def readWrite(self): f = File("test_read_write.txt") content = "Hello\nI am a file" f.writeContent(content) readContent = f.readContent() assert(content == readContent) f.removeFile() f = File("test_read_write2.txt") content = "Hello\nI am a file" f.writeContent(content) content = "This is another content for the file" f.writeContent(content) readContent = f.readContent() assert(content == readContent) f.removeFile()
def test_remove(self): f = File("hello") f.removeFile() self.assertFalse(f.exists())
def remove(self): f = File("hello") f.removeFile() assert(not f.exists())