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.
This commit is contained in:
Jurko Gospodnetić 2014-07-02 18:30:42 +02:00
parent 3580611a8c
commit 9e16d24385
2 changed files with 5 additions and 1 deletions

View File

@ -638,7 +638,7 @@ class TestTransportUsage:
xsd_content = '<xsd:element name="Data" type="xsd:string"/>'
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"

View File

@ -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