From e7c3f9a419a125870cce1e36966a4f5506a30780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 26 Jul 2015 15:05:32 +0200 Subject: [PATCH] test looking for a type in an XSD with recursive type definition --- tests/test_suds.py | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/tests/test_suds.py b/tests/test_suds.py index ea4b29a..5778126 100644 --- a/tests/test_suds.py +++ b/tests/test_suds.py @@ -1332,6 +1332,93 @@ def test_parameter_referencing_missing_element(monkeypatch): del e # explicitly break circular reference chain in Python 3 +class TestFindTypeInXSDSchemaWithRecursiveTypeDefinitions: + """Must not cause an infinite loop.""" + + def test_with_recursion_in_imported_schema(self): + client = testutils.client_from_wsdl(b("""\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +""")) + assert pytest.raises( + suds.TypeNotFound, client.factory.create, 'ns:DoesNotExist') + + def test_with_recursion_in_same_schema(self): + client = testutils.client_from_wsdl(b("""\ + + + + + + + + + + + + + + + + + + + + + + + + +""")) + assert pytest.raises( + suds.TypeNotFound, client.factory.create, 'ns:DoesNotExist') + + def test_recursive_XSD_import(): url_xsd = "suds://xsd" xsd = b("""\