def test_text_save_file(self): document = Document() document.text = "this is only a test of save file" document.path = "test_file" document.save() text_file = open(document.path, "r") self.assertEquals(document.text, text_file.read())
def test_save_inexistent_file(self): document = Document() document.text = "this is only a test of save file" document.path = "test_file" document.save() self.assertTrue(os.path.exists(document.path)) self.assertEquals("this is only a test of save file", document.text)
def test_replace_text_save_file(self): text_file = open("test_file", "w") text_file.write("this is only a test file") text_file.close() document = Document() document.text = "I changed the text" document.path = "test_file" document.save() text_file = open("test_file", "r") self.assertEquals(document.text, text_file.read())
def test_replace_text_save_file(self): text_file = open("test_file", "w") text_file.write("this is only a test file") text_file.close() document = Document() document.text = "I changed the text" document.path = "test_file" document.save() text_file = open ("test_file", "r") self.assertEquals(document.text, text_file.read())