Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests in 0.24.0 #290

Closed
mbehrle opened this issue Dec 22, 2016 · 7 comments
Closed

Failing tests in 0.24.0 #290

mbehrle opened this issue Dec 22, 2016 · 7 comments

Comments

@mbehrle
Copy link

mbehrle commented Dec 22, 2016

Thanks for reacting promptly to those last issues.

Now the run of the test suite during the build of 0.24.0 in Debian fails with the attached output.

`
I: pybuild base:184: cd /<>/.pybuild/pythonX.Y_2.7/build; python2.7 -m pytest tests
============================= test session starts ==============================
platform linux2 -- Python 2.7.13, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir: /<>, inifile:
plugins: cov-2.4.0
collected 346 items

tests/test_cache.py ....
tests/test_client.py ................
tests/test_client_factory.py ....
tests/test_helpers.py ....
tests/test_main.py ..
tests/test_pprint.py ..
tests/test_response.py .
tests/test_transports.py ...
tests/test_wsa.py ...
tests/test_wsdl.py .............
tests/test_wsdl_arrays.py FFFFFF
tests/test_wsdl_messages_document.py .................
tests/test_wsdl_messages_http.py .......
tests/test_wsdl_messages_rpc.py ..F...
tests/test_wsdl_soap.py ..
tests/test_wsse_username.py .....
tests/test_wsse_utils.py .
tests/test_xsd.py .................
tests/test_xsd_any.py .......
tests/test_xsd_attributes.py ...........
tests/test_xsd_builtins.py .........................................
tests/test_xsd_choice.py ......................
tests/test_xsd_complex_types.py .....
tests/test_xsd_extension.py ...........
tests/test_xsd_integration.py .........................
tests/test_xsd_parse.py ......................
tests/test_xsd_schemas.py ......................
tests/test_xsd_signatures.py .......
tests/test_xsd_simple_types.py ......
tests/test_xsd_types.py .........
tests/test_xsd_union.py ..
tests/test_xsd_valueobjects.py ...................
tests/test_xsd_visitor.py ....................
tests/integration/test_hello_world_recursive.py .
tests/integration/test_http_post.py ..
tests/integration/test_recursive_schema.py .

=================================== FAILURES ===================================
_______________________________ test_simple_type _______________________________

def test_simple_type():
    schema = xsd.Schema(load_xml("""
    <xsd:schema
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        targetNamespace="http://tests.python-zeep.org/tns">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <xsd:complexType name="ArrayOfString">
        <xsd:complexContent>
          <xsd:restriction base="SOAP-ENC:Array">
            <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:schema>
  """), transport=get_transport())

tests/test_wsdl_arrays.py:33:


tests/test_wsdl_arrays.py:13: in get_transport
load_xml(io.open('tests/wsdl_files/soap-enc.xsd', 'r').read().encode('utf-8')))


self = <encodings.ascii.IncrementalDecoder object at 0x7f11234e33d0>
input = '\n\n<!-- Schema for the SOAP/1.1 encoding\n\nPortions \xc2\xa9 2001 Develo... </xs:extension>\n </xs:simpleContent>\n </xs:complexType>\n\n <xs:element name="anyType" />\n</xs:schema>\n'
final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128)

/usr/lib/python2.7/encodings/ascii.py:26: UnicodeDecodeError
______________________________ test_complex_type _______________________________

def test_complex_type():
    schema = xsd.Schema(load_xml("""
    <xsd:schema
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:tns="http://tests.python-zeep.org/tns"
        targetNamespace="http://tests.python-zeep.org/tns">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

      <xsd:complexType name="ArrayObject">
        <xsd:sequence>
          <xsd:element name="attr_1" type="xsd:string"/>
          <xsd:element name="attr_2" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="ArrayOfObject">
        <xsd:complexContent>
          <xsd:restriction base="SOAP-ENC:Array">
            <xsd:sequence>
              <xsd:element name="obj" type="tns:ArrayObject" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:ArrayObject[]"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:schema>
  """), transport=get_transport())

tests/test_wsdl_arrays.py:83:


tests/test_wsdl_arrays.py:13: in get_transport
load_xml(io.open('tests/wsdl_files/soap-enc.xsd', 'r').read().encode('utf-8')))


self = <encodings.ascii.IncrementalDecoder object at 0x7f1123671b50>
input = '\n\n<!-- Schema for the SOAP/1.1 encoding\n\nPortions \xc2\xa9 2001 Develo... </xs:extension>\n </xs:simpleContent>\n </xs:complexType>\n\n <xs:element name="anyType" />\n</xs:schema>\n'
final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128)

/usr/lib/python2.7/encodings/ascii.py:26: UnicodeDecodeError
________________________ test_complex_type_without_name ________________________

def test_complex_type_without_name():
    schema = xsd.Schema(load_xml("""
    <xsd:schema
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:tns="http://tests.python-zeep.org/tns"
        targetNamespace="http://tests.python-zeep.org/tns">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

      <xsd:complexType name="ArrayObject">
        <xsd:sequence>
          <xsd:element name="attr_1" type="xsd:string"/>
          <xsd:element name="attr_2" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="ArrayOfObject">
        <xsd:complexContent>
          <xsd:restriction base="SOAP-ENC:Array">
            <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:ArrayObject[]"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:schema>
  """), transport=get_transport())

tests/test_wsdl_arrays.py:140:


tests/test_wsdl_arrays.py:13: in get_transport
load_xml(io.open('tests/wsdl_files/soap-enc.xsd', 'r').read().encode('utf-8')))


self = <encodings.ascii.IncrementalDecoder object at 0x7f11236713d0>
input = '\n\n<!-- Schema for the SOAP/1.1 encoding\n\nPortions \xc2\xa9 2001 Develo... </xs:extension>\n </xs:simpleContent>\n </xs:complexType>\n\n <xs:element name="anyType" />\n</xs:schema>\n'
final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128)

/usr/lib/python2.7/encodings/ascii.py:26: UnicodeDecodeError
_______________________ test_soap_array_parse_remote_ns ________________________

def test_soap_array_parse_remote_ns():
    transport = DummyTransport()
    transport.bind(
        'http://schemas.xmlsoap.org/soap/encoding/',
      load_xml(io.open('tests/wsdl_files/soap-enc.xsd', 'r').read().encode('utf-8')))

tests/test_wsdl_arrays.py:177:


self = <encodings.ascii.IncrementalDecoder object at 0x7f1123671910>
input = '\n\n<!-- Schema for the SOAP/1.1 encoding\n\nPortions \xc2\xa9 2001 Develo... </xs:extension>\n </xs:simpleContent>\n </xs:complexType>\n\n <xs:element name="anyType" />\n</xs:schema>\n'
final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128)

/usr/lib/python2.7/encodings/ascii.py:26: UnicodeDecodeError
_____________________________ test_wsdl_array_type _____________________________

def test_wsdl_array_type():
    transport = DummyTransport()
    transport.bind(
        'http://schemas.xmlsoap.org/soap/encoding/',
      load_xml(io.open('tests/wsdl_files/soap-enc.xsd', 'r').read().encode('utf-8')))

tests/test_wsdl_arrays.py:239:


self = <encodings.ascii.IncrementalDecoder object at 0x7f11234e0e90>
input = '\n\n<!-- Schema for the SOAP/1.1 encoding\n\nPortions \xc2\xa9 2001 Develo... </xs:extension>\n </xs:simpleContent>\n </xs:complexType>\n\n <xs:element name="anyType" />\n</xs:schema>\n'
final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128)

/usr/lib/python2.7/encodings/ascii.py:26: UnicodeDecodeError
____________________________ test_soap_array_parse _____________________________

def test_soap_array_parse():
    transport = DummyTransport()
    transport.bind(
        'http://schemas.xmlsoap.org/soap/encoding/',
      load_xml(io.open('tests/wsdl_files/soap-enc.xsd', 'r').read().encode('utf-8')))

tests/test_wsdl_arrays.py:303:


self = <encodings.ascii.IncrementalDecoder object at 0x7f1123528790>
input = '\n\n<!-- Schema for the SOAP/1.1 encoding\n\nPortions \xc2\xa9 2001 Develo... </xs:extension>\n </xs:simpleContent>\n </xs:complexType>\n\n <xs:element name="anyType" />\n</xs:schema>\n'
final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128)

/usr/lib/python2.7/encodings/ascii.py:26: UnicodeDecodeError
_______________________ test_wsdl_array_of_simple_types ________________________

def test_wsdl_array_of_simple_types():
    wsdl_content = StringIO("""
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
        targetNamespace="http://tests.python-zeep.org/tns"
        xmlns:tns="http://tests.python-zeep.org/tns"
        xmlns:impl="http://tests.python-zeep.org/tns"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tests.python-zeep.org/tns">
          <complexType name="ArrayOfString">
            <complexContent>
              <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
              </restriction>
            </complexContent>
          </complexType>
        </schema>
      </types>
      <portType name="SimpleTypeArrayPortType">
        <operation name="getSimpleArray">
          <input message="tns:getSimpleArrayRequest"/>
          <output message="tns:getSimpleArrayResponse"/>
        </operation>
      </portType>
      <binding name="SimpleTypeArrayBinding" type="tns:SimpleTypeArrayPortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="getSimpleArray">
          <soap:operation soapAction=""/>
          <input>
            <soap:body use="encoded" namespace="http://tests.python-zeep.org/tns" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
          </input>
          <output>
            <soap:body parts="return" use="encoded" namespace="http://tests.python-zeep.org/tns" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
          </output>
        </operation>
      </binding>
      <message name="getSimpleArrayRequest"/>
      <message name="getSimpleArrayResponse">
        <part name="return" type="tns:ArrayOfString"/>
      </message>
    </definitions>
    """.strip())  # noqa

    transport = DummyTransport()
    transport.bind(
        'http://schemas.xmlsoap.org/soap/encoding/',
      load_xml(io.open('tests/wsdl_files/soap-enc.xsd', 'r').read().encode('utf-8')))

tests/test_wsdl_messages_rpc.py:210:


self = <encodings.ascii.IncrementalDecoder object at 0x7f1123528e50>
input = '\n\n<!-- Schema for the SOAP/1.1 encoding\n\nPortions \xc2\xa9 2001 Develo... </xs:extension>\n </xs:simpleContent>\n </xs:complexType>\n\n <xs:element name="anyType" />\n</xs:schema>\n'
final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128)

/usr/lib/python2.7/encodings/ascii.py:26: UnicodeDecodeError
===================== 7 failed, 339 passed in 1.28 seconds =====================
E: pybuild pybuild:276: test: plugin distutils failed with: exit code=1: cd /<>/.pybuild/pythonX.Y_2.7/build; python2.7 -m pytest tests

`

@mvantellingen
Copy link
Owner

Do you have any information for me how to reproduce this?

@mbehrle
Copy link
Author

mbehrle commented Dec 28, 2016

This errors are thrown inside a standard Debian sbuild (representing an isolated clean environment of a standard Debian base system). The command line leading to the errors is:

python2.7 -m pytest tests

I have attached the complete build log for reference.

python-zeep_0.24.0-1_amd64-2016-12-22T16:54:03Z.build.txt

@mvantellingen
Copy link
Owner

Bit weird, it seems it errors when reading the wsdl files in the test directory. Is there a simple way for me to reproduce it?

@mbehrle
Copy link
Author

mbehrle commented Jan 31, 2017

Yes, weird. I ran the tests from trunk in a virtualenv and they succeeded.

I tried again with sbuild on release 0.27.0 and it still throws the errors. So I suppose it is due to sanitizing of the build environment inside sbuild (or pbuilder).

If you have a Debian system at hand the easiest way to reproduce would be to setup sbuild (or pbuilder) with an unstable chroot, grab the Debian repos
git clone https://anonscm.debian.org/git/tryton/python-zeep.git
cd python-zeep
sbuild

@mvantellingen
Copy link
Owner

I tried to do that but I failed :-( Are you able to create a dockerfile which exposes the issue?

@mbehrle
Copy link
Author

mbehrle commented Jun 13, 2017

I am not yet able to reproduce the issue outside an sbuild environment (Note: sbuild environments are strictly cleaned up for environment variables). I confirm the test suite runs without error in a local tox environment.

JFTR I could meanwhile get the tests in question running by just replacing the offending copyright char.
https://anonscm.debian.org/cgit/tryton/python-zeep.git/tree/debian/patches/02-fix-soap-enc.xsd-copyright-char.patch

Still investigating further, what is missing inside the sbuild chroot to get those tests running out of the box.

@rathann
Copy link

rathann commented Jan 24, 2018

I can still reproduce this with 2.5.0 on Fedora 27 (using system packages, not virtualenv), but only with python2 (2.7.14), not python3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants