Esempio n. 1
0
    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())
Esempio n. 2
0
    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()
Esempio n. 3
0
 def test_remove(self):
     f = File("hello")
     f.removeFile()
     self.assertFalse(f.exists())
Esempio n. 4
0
 def remove(self): 
     f = File("hello")
     f.removeFile()
     assert(not f.exists())