Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_nested_attribute():
schema = xsd.Schema(
load_xml(
"""
<element name="container">
<element name="item">
<element name="x">
</element></element></element>
def test_xml_group_methods():
schema = xsd.Schema(
load_xml(
"""
blub
def test_parse_check_unexpected():
schema = xsd.Schema(
load_xml(
"""
def test_complex_type_with_attributes():
schema = xsd.Schema(
load_xml(
"""
"""
)
""".strip()
)
schema = xsd.Schema(node)
container_elm = schema.get_element("ns0:container")
assert container_elm.type.signature(schema=schema) == (
"ns0:container(something: xsd:string, ({item_1: xsd:string} | {item_2: xsd:string} | {item_3: xsd:string}))"
)
value = container_elm(something="foobar", item_1="item-1")
expected = """
foobar
item-1
"""
node = etree.Element("document")
def test_complex_type(transport):
schema = xsd.Schema(
load_xml(
"""
def test_attribute_list_type():
schema = xsd.Schema(
load_xml(
"""
<element name="container">
<element name="foo"></element></element>
def test_xml_group_via_ref():
schema = xsd.Schema(
load_xml(
"""
def test_ref_attribute_qualified():
schema = xsd.Schema(
load_xml(
"""
"""
def test_sequence_parse_anytype_nil():
schema = xsd.Schema(
load_xml(
b"""
"""