Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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
Example #4
0
 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
Example #5
0
 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.")
Example #6
0
 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())
Example #9
0
 def tearDown(self):
     DATA_MODIFIED.saved()
     if os.path.exists(SAVED_XML):
         os.remove(SAVED_XML)
Example #10
0
 def tearDown(self):
     DATA_MODIFIED.saved()
Example #11
0
 def _should_not_be_modified(self, item):
     self.assertFalse(item.is_modified)
     self.assertFalse(DATA_MODIFIED.is_modified())
Example #12
0
 def _should_be_modified(self, item):
     self.assertTrue(item.is_modified)
     self.assertTrue(DATA_MODIFIED.is_modified())
Example #13
0
 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.")
Example #14
0
 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.")
Example #15
0
 def tearDown(self):
     DATA_MODIFIED.saved()
     io.SETTINGS = self.orig_settings
 def tearDown(self):
     DATA_MODIFIED.saved()
 def tearDown(self):
     DATA_MODIFIED.saved()
     if os.path.exists(SAVED_XML):
         os.remove(SAVED_XML)
Example #18
0
 def tearDown(self):
     DATA_MODIFIED.saved()
     io.SETTINGS = self.orig_settings