def test_save_data_without_output_and_modifications(self): generated = self.io._get_xml_generation_time() DATA_MODIFIED.modified() saved, changes = self.io.save_data(None, None) self.assertNotEquals(generated, self.io._get_xml_generation_time()) self.assertTrue(saved) self.assertFalse(changes)
def tearDown(self): _TestIO.tearDown(self) shutil.move(HTML_DATASOURCES_XML + '.utest', HTML_DATASOURCES_XML) backup = HTML_DATASOURCES_XML + '.bak' if os.path.exists(backup): os.remove(backup) DATA_MODIFIED.saved() io.SETTINGS["always_load_old_data_from_xml"] = self._orig_always_load io.SETTINGS["check_simultaneous_save"] = self._orig_check
def tearDown(self): _TestIO.tearDown(self) shutil.move(HTML_DATASOURCES_XML+'.utest', HTML_DATASOURCES_XML) backup = HTML_DATASOURCES_XML + '.bak' if os.path.exists(backup): os.remove(backup) DATA_MODIFIED.saved() io.SETTINGS["always_load_old_data_from_xml"] = self._orig_always_load io.SETTINGS["check_simultaneous_save"] = self._orig_check
def test_load_datasource_and_xml_with_updates_in_html(self): io.SETTINGS["always_load_old_data_from_xml"] = True suite = self._test_loading(HTML_DATASOURCE_WITH_UPDATES, 'Html With Updates') self.assertEquals(len(suite.tests), 2) self.assertEquals(suite.tests[0].message, 'Failure!') self.assertTrue(DATA_MODIFIED.is_modified(), "Status should be True as there is modifications.")
def _should_not_be_modified(self, item): self.assertFalse(item.is_modified) self.assertFalse(DATA_MODIFIED.is_modified())
def _should_be_modified(self, item): self.assertTrue(item.is_modified) self.assertTrue(DATA_MODIFIED.is_modified())
def tearDown(self): DATA_MODIFIED.saved() if os.path.exists(SAVED_XML): os.remove(SAVED_XML)
def tearDown(self): DATA_MODIFIED.saved()
def test_load_datasource_and_xml_with_no_updates_in_html(self): io.SETTINGS["always_load_old_data_from_xml"] = True self._test_loading(HTML_DATASOURCE_WITH_XML, 'Testcases2') self.assertFalse(DATA_MODIFIED.is_modified(), "Status should be False as there is no modifications.")
def test_load_datasource_and_xml_with_no_updates_in_html(self): io.SETTINGS["always_load_old_data_from_xml"] = True self._test_loading(HTML_DATASOURCE_WITH_XML, 'Testcases2') self.assertFalse( DATA_MODIFIED.is_modified(), "Status should be False as there is no modifications.")
def tearDown(self): DATA_MODIFIED.saved() io.SETTINGS = self.orig_settings