Skip to content
Snippets Groups Projects
Commit 3a9ca4f3 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

MAINT: refactored xml tests

parent a6c1fcaf
No related branches found
No related tags found
2 merge requests!181Release 0.9.0,!174XML Converter
Pipeline #54414 failed
......@@ -256,19 +256,12 @@ def test_namespace_xml(converter_registry):
</root>
"""
conv_tail = """
default_namespace: default
subtree:
Text:
type: XMLTextNode
match: (?P<result>.*)
"""
converter = XMLTagConverter(yaml.safe_load("""
type: XMLTag
match_tag: "{default-namespace}root"
xpath: "default:node1/text()"
""" + conv_tail), "TestXMLTagConverter", converter_registry)
default_namespace: default
"""), "TestXMLTagConverter", converter_registry)
tag = XMLTagElement(fromstring(xml_text))
m = converter.match(tag)
......@@ -281,10 +274,11 @@ xpath: "default:node1/text()"
type: XMLTag
match_tag: "{default-namespace}root"
xpath: "default:node1"
default_namespace: default
attribs_as_children: false
text_as_children: true
tags_as_children: false
""" + conv_tail), "TestXMLTagConverter", converter_registry)
"""), "TestXMLTagConverter", converter_registry)
children = converter.create_children(GeneralStore(), tag)
assert len(children) == 2
assert children[0].name == "{default-namespace}node1[1]/text()"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment