From 9e16d24385856ff86507943caa275157c5a55786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Wed, 2 Jul 2014 18:30:42 +0200 Subject: [PATCH] correct accidental test WSDL schema content TestTransportUsage.test_operation_request_and_reply() test in the test_client.py module used a WSDL schema that worked fine for that specific test case but did not exactly match what the developer originally intended. Part of the WSDL's XSD schema definition got formatted as an embedded Python bytes literal (b"...") instead of a simple string, resulting in some extra 'b"' & '"' textual XML data. The extra text data got ignored by suds when parsing that XSD but it was still not intended to be there in the first place. Added an assertion to catch cases where such a problem might try and sneak by us again in the future. --- tests/test_client.py | 2 +- tests/testutils/__init__.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index 59f822e..623c8a8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -638,7 +638,7 @@ class TestTransportUsage: xsd_content = '' web_service_URL = "Great minds think alike" xsd_target_namespace = "omicron psi" - wsdl = testutils.wsdl(b(xsd_content), operation_name="pi", + wsdl = testutils.wsdl(xsd_content, operation_name="pi", xsd_target_namespace=xsd_target_namespace, input="Data", output="Data", web_service_URL=web_service_URL) test_input_data = "Riff-raff" diff --git a/tests/testutils/__init__.py b/tests/testutils/__init__.py index 0062a90..923855d 100644 --- a/tests/testutils/__init__.py +++ b/tests/testutils/__init__.py @@ -23,6 +23,8 @@ Package containing different utilities used for suds project testing. import suds.client import suds.store +import six + import os import subprocess import sys @@ -153,6 +155,8 @@ def wsdl(schema_content, input=None, output=None, operation_name="f", name. """ + assert isinstance(schema_content, six.string_types) + has_input = input is not None has_output = output is not None