def test02_FolderExporterPostProcess(self): """Test folder exporter post processing""" e = FolderExporter() result = WriterResult() result.index_file = '/tmp/file.htm' e.postProcess(result) self.assertEqual(e.destinationUrl(), '/tmp/file.htm')
def test03_FolderExporterSaveReadFromProject(self): """Test saving and restoring folder exporter settings in project""" e = FolderExporter() e.folder = '/my_folder' e.writeToProject() restored = FolderExporter() restored.readFromProject() self.assertEqual(restored.exportDirectory(), '/my_folder')
def test05_RegistrySaveReadFromProject(self): """ test saving and restoring current exporter in project""" e = FolderExporter() e.folder = '/my_folder' EXPORTER_REGISTRY.writeToProject(e) restored = EXPORTER_REGISTRY.createFromProject() self.assertEqual(type(restored), FolderExporter) self.assertEqual(restored.exportDirectory(), '/my_folder') # try with a non-folder exporter f = FtpExporter() EXPORTER_REGISTRY.writeToProject(f) restored = EXPORTER_REGISTRY.createFromProject() self.assertEqual(type(restored), FtpExporter)
def test01_FolderExporterDefaultsToTemp(self): """Test that folder exporter defaults to a temporary folder""" e = FolderExporter() self.assertTrue(e.exportDirectory())