@@ -1222,3 +1222,44 @@ def test_import_cyclic():
12221222
12231223 document = wsdl .Document (
12241224 wsdl_content , transport , 'https://tests.python-zeep.org/content.wsdl' )
1225+
1226+
1227+ def test_import_no_location ():
1228+ node_a = etree .fromstring ("""
1229+ <?xml version="1.0"?>
1230+ <xs:schema
1231+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
1232+ xmlns:tns="http://tests.python-zeep.org/a"
1233+ targetNamespace="http://tests.python-zeep.org/a"
1234+ xmlns:b="http://tests.python-zeep.org/b"
1235+ elementFormDefault="qualified">
1236+
1237+ </xs:schema>
1238+ """ .strip ())
1239+
1240+ wsdl_content = StringIO ("""
1241+ <?xml version='1.0'?>
1242+ <definitions
1243+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
1244+ xmlns:tns="http://tests.python-zeep.org/root"
1245+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
1246+ xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tests.python-zeep.org/root" name="root">
1247+ <types>
1248+ <xsd:schema
1249+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
1250+ xmlns:tns="http://tests.python-zeep.org/b"
1251+ targetNamespace="http://tests.python-zeep.org/b"
1252+ elementFormDefault="qualified">
1253+
1254+ <xs:import namespace="http://tests.python-zeep.org/a"/>
1255+ <xs:element name="foo" type="xs:string"/>
1256+ </xsd:schema>
1257+ </types>
1258+ </definitions>
1259+ """ .strip ())
1260+
1261+ transport = DummyTransport ()
1262+ transport .bind ('https://tests.python-zeep.org/a.xsd' , node_a )
1263+
1264+ document = wsdl .Document (
1265+ wsdl_content , transport , 'https://tests.python-zeep.org/content.wsdl' )
0 commit comments