Skip to content

Commit c09bb53

Browse files
committed
Add test for CompoundValueObject iteration
1 parent aa8a6e0 commit c09bb53

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/test_xsd.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ def test_element_simple_type():
7272
assert_nodes_equal(expected, node)
7373

7474

75+
def test_complex_type():
76+
custom_type = xsd.ComplexType(
77+
xsd.Sequence([
78+
xsd.Element(
79+
etree.QName('http://tests.python-zeep.org/', 'username'),
80+
xsd.String()),
81+
xsd.Element(
82+
etree.QName('http://tests.python-zeep.org/', 'password'),
83+
xsd.String()),
84+
])
85+
)
86+
obj = custom_type('user', 'pass')
87+
assert {key: obj[key] for key in obj} == {
88+
'username': 'user',
89+
'password': 'pass'
90+
}
91+
92+
7593
def test_nil_elements():
7694
custom_type = xsd.Element(
7795
'{http://tests.python-zeep.org/}container',

0 commit comments

Comments
 (0)