Skip to content

Commit

Permalink
adding testcase for nested elements with more than one children issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mukultaneja authored and sanand0 committed Aug 1, 2017
1 parent 87a1e85 commit 16b2c0b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_xmljson.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ def test_data(self):
eq('{"alice": {"attributes": {"charlie": "david"}, "children": ["bob"]}}',
'<alice charlie="david">bob</alice>')

# Nested elements with more than one children
eq('{"Data": {"attributes": {"version": 9.0,"{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation": "comp.xsd"},"children": [{"Airport": {"attributes": {"country": "Samoa","city": "Apia","name": "Faleolo Intl","lat": -13.8296668231487,"lon": -171.997166723013,"alt": "17.678M","ident": "NSFA"},"children": [{"Services": {"Fuel": {"attributes": {"type": "JETA","availability": "YES"}}}},{"Tower": {"attributes": {"lat": -13.8320958986878,"lon": -171.998676359653,"alt": "0.0M"}},"Runway": {"attributes": {"lat": -13.8300792127848,"lon": -172.008545994759,"alt": "17.678M","surface": "ASPHALT","heading": 89.3199996948242,"length": "2999.23M","width": "45.11M","number": 8,"designator": "NONE"}}}]}}]}}',
'<Data version="9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="comp.xsd"><Airport country="Samoa" city="Apia" name="Faleolo Intl" lat="-13.8296668231487" lon="-171.997166723013" alt="17.678M" ident="NSFA"><Services><Fuel type="JETA" availability="YES"/></Services><Tower lat="-13.8320958986878" lon="-171.998676359653" alt="0.0M"></Tower><Runway lat="-13.8300792127848" lon="-172.008545994759" alt="17.678M" surface="ASPHALT" heading="89.3199996948242" length="2999.23M" width="45.11M" number="08" designator="NONE"></Runway></Airport></Data>')


class TestCobra(TestXmlJson):
@unittest.skip('To be written')
Expand Down

0 comments on commit 16b2c0b

Please sign in to comment.