Exemplo n.º 1
0
    def testSaveUnnamed(self):
        doc = TextDocument()
        self.assertRaises(TextDocument.MissingFilenameException, lambda: doc.save())

        path = fixtures.tempFile("testSaveUnnamed")
        doc.saveAs(path)
        self.assertTrue(os.path.exists(path))
        self.assertEqual(doc.filename(), path)
Exemplo n.º 2
0
 def testSave(self):
     path = fixtures.tempFile("testSave")
     doc = TextDocument()
     doc.setFilename(path)
     doc.save()
     self.assertTrue(os.path.exists(path))