add failing recursive XSD import test

This commit is contained in:
Jurko Gospodnetić 2015-07-01 10:29:26 +02:00
parent 1528dd0641
commit 02c651cea2
1 changed files with 20 additions and 0 deletions

View File

@ -30,6 +30,7 @@ if __name__ == "__main__":
testutils.run_using_pytest(globals())
import suds
import suds.store
from testutils.compare_sax import CompareSAX
import pytest
@ -2029,6 +2030,25 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
("DoesNotExist", "OMG"))
@pytest.mark.xfail
def test_recursive_XSD_import():
url_xsd = "suds://xsd"
xsd = b("""\
<xsd:schema targetNamespace="my-xsd-namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="my-xsd-namespace" schemaLocation="%(url_imported)s"/>
</xsd:schema>
""" % dict(url_imported=url_xsd))
wsdl = b("""\
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions targetNamespace="my-wsdl-namespace"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:import location="%(url_imported)s"/>
</wsdl:definitions>""" % dict(url_imported=url_xsd))
store = suds.store.DocumentStore(xsd=xsd)
testutils.client_from_wsdl(wsdl, documentStore=store)
def _assert_dynamic_type(anObject, typename):
assert anObject.__module__ == suds.sudsobject.__name__
assert anObject.__metadata__.sxtype.name == typename