File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,28 @@ def test_way_missing_data(self):
171171 overpy .Way .from_xml (node )
172172
173173
174+ class TestParser (BaseTestNodes ):
175+ def test_exception (self ):
176+ with pytest .raises (overpy .exception .OverPyException ):
177+ overpy .Result .from_xml (123 )
178+
179+ def test_xml_element (self ):
180+ import xml .etree .ElementTree as ET
181+ data = read_file ("xml/node-01.xml" )
182+ root = ET .fromstring (data )
183+ result = overpy .Result .from_xml (root )
184+
185+ assert isinstance (result , overpy .Result )
186+ self ._test_node01 (result )
187+
188+ def test_xml_autodetect_parser (self ):
189+ data = read_file ("xml/node-01.xml" )
190+ result = overpy .Result .from_xml (data )
191+
192+ assert isinstance (result , overpy .Result )
193+ self ._test_node01 (result )
194+
195+
174196class TestRemark (object ):
175197 def test_remark_runtime_error (self ):
176198 api = overpy .Overpass ()
You can’t perform that action at this time.
0 commit comments