Пример #1
0
 def test_fill_testcase_response(self, fname):
     xml_root = utils.get_xml_root(os.path.join(conf.DATA_PATH, fname))
     name, value = properties.fill_response_property(xml_root)
     filled = utils.etree_to_string(xml_root)
     assert name == "dump2polarion"
     assert value
     assert '<response-property name="dump2polarion" value=' in filled
Пример #2
0
 def test_fill_testsuites_response(self):
     fname = "complete_transform_noresponse.xml"
     xml_root = utils.get_xml_root(os.path.join(conf.DATA_PATH, fname))
     name, value = properties.fill_response_property(xml_root)
     filled = utils.etree_to_string(xml_root)
     assert name == "dump2polarion"
     assert value
     assert '<property name="polarion-response-dump2polarion" value=' in filled
Пример #3
0
 def test_fill_custom_testcase_response(self):
     fname = "testcases_noresponse.xml"
     xml_root = utils.get_xml_root(os.path.join(conf.DATA_PATH, fname))
     name, value = properties.fill_response_property(
         xml_root, "test", "test")
     filled = utils.etree_to_string(xml_root)
     assert name == "test"
     assert value == "test"
     assert '<response-property name="test" value="test"' in filled
     # make sure response properties are on top
     assert '<testcases project-id="RHCF3"><response-properties>' in filled
Пример #4
0
 def test_fill_invalid_testsuites_response(self):
     xml_root = utils.get_xml_root_from_str("<invalid/>")
     with pytest.raises(Dump2PolarionException) as excinfo:
         properties.fill_response_property(xml_root, "test", "test")
     assert "XML file is not in expected format" in str(excinfo.value)
Пример #5
0
 def test_nofill_response(self, fname):
     xml_root = utils.get_xml_root(os.path.join(conf.DATA_PATH, fname))
     name, value = properties.fill_response_property(xml_root)
     assert name == "test"
     assert value == "test"