Example #1
0
 def test_properties_lookup_config(self, records_names):
     new_config = copy.deepcopy(self.config_prop)
     new_config["xunit_import_properties"]["polarion-lookup-method"] = "id"
     exporter = XunitExport("5_8_0_17",
                            records_names,
                            new_config,
                            transform_func=lambda: None)
     top_element = exporter._top_element()
     properties_element = exporter._properties_element(top_element)
     exporter._fill_lookup_prop(properties_element)
     properties_str = get_unicode_str(
         etree.tostring(properties_element, encoding="utf-8").strip())
     assert '<property name="polarion-lookup-method" value="id"/>' in properties_str
Example #2
0
 def test_properties_element(self, records_ids):
     exporter = XunitExport("5_8_0_17",
                            records_ids,
                            self.config_prop,
                            transform_func=lambda: None)
     top_element = exporter._top_element()
     properties_element = exporter._properties_element(top_element)
     parsed = (
         "<properties>"
         '<property name="polarion-testrun-id" value="5_8_0_17"/>'
         '<property name="polarion-project-id" value="RHCF3"/>'
         '<property name="polarion-dry-run" value="False"/>'
         '<property name="polarion-response-test" value="test"/>'
         '<property name="polarion-testrun-status-id" value="inprogress"/>'
         "</properties>".strip())
     properties_str = get_unicode_str(
         etree.tostring(properties_element, encoding="utf-8").strip())
     assert properties_str == parsed