diff --git a/debian/patches/01-remove-failing-tests.patch b/debian/patches/01-remove-failing-tests.patch new file mode 100644 index 0000000..d5f8ebf --- /dev/null +++ b/debian/patches/01-remove-failing-tests.patch @@ -0,0 +1,185 @@ +Description: Remove some failing tests due to missing build dependencies + The following tests fail due to missing build dependencies + tests/test_wsse_signature.py: xmlsec + tests/test_asyncio_transport.py: aioresponses +Author: Mathias Behrle +Forwarded: not needed + +--- a/tests/test_wsse_signature.py ++++ /dev/null +@@ -1,112 +0,0 @@ +-import os +-import sys +- +-import pytest +- +-from tests.utils import load_xml +-from zeep.exceptions import SignatureVerificationFailed +-from zeep import wsse +-from zeep.wsse import signature +- +-DS_NS = 'http://www.w3.org/2000/09/xmldsig#' +- +- +-KEY_FILE = os.path.join( +- os.path.dirname(os.path.realpath(__file__)), 'cert_valid.pem') +-KEY_FILE_PW = os.path.join( +- os.path.dirname(os.path.realpath(__file__)), 'cert_valid_pw.pem') +- +- +-@pytest.mark.skipif(sys.platform == 'win32', +- reason="does not run on windows") +-def test_sign(): +- envelope = load_xml(""" +- +- +- +- +- OK +- +- +- +- """) +- +- signature.sign_envelope(envelope, KEY_FILE, KEY_FILE) +- signature.verify_envelope(envelope, KEY_FILE) +- +- +-@pytest.mark.skipif(sys.platform == 'win32', +- reason="does not run on windows") +-def test_sign_pw(): +- envelope = load_xml(""" +- +- +- +- +- OK +- +- +- +- """) +- +- signature.sign_envelope(envelope, KEY_FILE_PW, KEY_FILE_PW, 'geheim') +- signature.verify_envelope(envelope, KEY_FILE_PW) +- +- +-@pytest.mark.skipif(sys.platform == 'win32', +- reason="does not run on windows") +-def test_verify_error(): +- envelope = load_xml(""" +- +- +- +- +- OK +- +- +- +- """) +- +- signature.sign_envelope(envelope, KEY_FILE, KEY_FILE) +- nsmap = {'tns': 'http://tests.python-zeep.org/'} +- +- for elm in envelope.xpath('//tns:Argument', namespaces=nsmap): +- elm.text = 'NOT!' +- +- with pytest.raises(SignatureVerificationFailed): +- signature.verify_envelope(envelope, KEY_FILE) +- +- +-@pytest.mark.skipif(sys.platform == 'win32', +- reason="does not run on windows") +-def test_signature(): +- envelope = load_xml(""" +- +- +- +- +- OK +- +- +- +- """) +- +- plugin = wsse.Signature(KEY_FILE_PW, KEY_FILE_PW, 'geheim') +- envelope, headers = plugin.apply(envelope, {}) +- plugin.verify(envelope) +--- a/tests/test_asyncio_transport.py ++++ /dev/null +@@ -1,60 +0,0 @@ +-import pytest +-from pretend import stub +-from lxml import etree +-import aiohttp +-from aioresponses import aioresponses +- +-from zeep import cache, asyncio +- +- +-@pytest.mark.requests +-def test_no_cache(event_loop): +- transport = asyncio.AsyncTransport(loop=event_loop) +- assert transport.cache is None +- +- +-@pytest.mark.requests +-def test_load(event_loop): +- cache = stub(get=lambda url: None, add=lambda url, content: None) +- transport = asyncio.AsyncTransport(loop=event_loop, cache=cache) +- +- with aioresponses() as m: +- m.get('http://tests.python-zeep.org/test.xml', body='x') +- result = transport.load('http://tests.python-zeep.org/test.xml') +- assert result == b'x' +- +- +-@pytest.mark.requests +-@pytest.mark.asyncio +-async def test_post(event_loop): +- cache = stub(get=lambda url: None, add=lambda url, content: None) +- transport = asyncio.AsyncTransport(loop=event_loop, cache=cache) +- +- envelope = etree.Element('Envelope') +- +- with aioresponses() as m: +- m.post('http://tests.python-zeep.org/test.xml', body='x') +- result = await transport.post_xml( +- 'http://tests.python-zeep.org/test.xml', +- envelope=envelope, +- headers={}) +- +- assert result.content == b'x' +- +- +-@pytest.mark.requests +-@pytest.mark.asyncio +-async def test_session_close(event_loop): +- transport = asyncio.AsyncTransport(loop=event_loop) +- session = transport.session # copy session object from transport +- del transport +- assert session.closed +- +- +-@pytest.mark.requests +-@pytest.mark.asyncio +-async def test_session_no_close(event_loop): +- session = aiohttp.ClientSession(loop=event_loop) +- transport = asyncio.AsyncTransport(loop=event_loop, session=session) +- del transport +- assert not session.closed diff --git a/debian/patches/02-fix-soap-enc.xsd-copyright-char.patch b/debian/patches/02-fix-soap-enc.xsd-copyright-char.patch new file mode 100644 index 0000000..8b8da72 --- /dev/null +++ b/debian/patches/02-fix-soap-enc.xsd-copyright-char.patch @@ -0,0 +1,36 @@ +Description: Replace the copyright sign by ASCII chars + The tests + tests/test_wsdl_arrays.py + tests/test_wsdl_messages_rpc.py + are failing in an sbuild environment with + UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 89: ordinal not in range(128) + while they succeed without error in the GitHub CI as well as in a local + virtual environment with tox. + + While investigating further this patch replaces for now the offending char. +Author: Mathias Behrle +Bug: http://bugs.tryton.org/issue4280 +Forwarded: https://github.com/mvantellingen/python-zeep/issues/290 + +--- a/tests/wsdl_files/soap-enc.xsd ++++ b/tests/wsdl_files/soap-enc.xsd +@@ -2,8 +2,8 @@ + +