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
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
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
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)
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"