14
0
forked from pool/python-zeep

- Update to 4.2.1:

* Fix error regarding closing session in async transport (#1347)
  * Drop support for Python 3.6
  * Allow embedding CDATA elements in simple types (#1339)
  * Allow to pass in a pre parsed Document (#1330)
  * Fix httpx DeprecationWarning for post data (#1326)
  * Add BinaryMemorySignature (#1300)
  * Fix IndexError when empty body response (#1287)
  * Add support for context manager on Client (#1166)
  * Allow Ws Addressing plugin to use a different URL (#1328)
  * Accept strings for xsd base64Binary (#1072)
- Drop patches httpx-test.patch, python-zeep-no-mock.patch:
  * Included upstream.
- Add patch xfail-network-tests.patch:
  * XFAIL, rather than FAIL tests that require a network connection.
- Switch to autosetup and pyproject macros.
- BuildRequire xmlsec unilaterally and install the openssl library.
- No longer ignore some test files

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zeep?expand=0&rev=18
This commit is contained in:
2023-12-15 06:37:51 +00:00
committed by Git OBS Bridge
parent cab59f0011
commit 155bebfe90
7 changed files with 51 additions and 100 deletions

View File

@@ -1,40 +0,0 @@
diff --git a/tests/test_async_transport.py b/tests/test_async_transport.py
index 940b48a..7cce440 100644
--- a/tests/test_async_transport.py
+++ b/tests/test_async_transport.py
@@ -21,7 +21,7 @@ def test_load(httpx_mock):
cache = stub(get=lambda url: None, add=lambda url, content: None)
transport = AsyncTransport(cache=cache)
- httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", data="x")
+ httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", text="x")
result = transport.load("http://tests.python-zeep.org/test.xml")
assert result == b"x"
@@ -32,7 +32,7 @@ def test_load_cache(httpx_mock):
cache = InMemoryCache()
transport = AsyncTransport(cache=cache)
- httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", data="x")
+ httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", text="x")
result = transport.load("http://tests.python-zeep.org/test.xml")
assert result == b"x"
@@ -47,7 +47,7 @@ async def test_post(httpx_mock: HTTPXMock):
envelope = etree.Element("Envelope")
- httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", data="x")
+ httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", text="x")
result = await transport.post_xml(
"http://tests.python-zeep.org/test.xml", envelope=envelope, headers={}
)
@@ -69,7 +69,7 @@ async def test_http_error(httpx_mock: HTTPXMock):
transport = AsyncTransport()
httpx_mock.add_response(
- url="http://tests.python-zeep.org/test.xml", data="x", status_code=500
+ url="http://tests.python-zeep.org/test.xml", text="x", status_code=500
)
with pytest.raises(exceptions.TransportError) as exc:
transport.load("http://tests.python-zeep.org/test.xml")

View File

@@ -1,39 +0,0 @@
diff --git a/setup.py b/setup.py
index dfa79a58..4cf9073b 100755
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,6 @@
tests_require = [
"coverage[toml]==5.2.1",
"freezegun==0.3.15",
- "mock==2.0.0",
"pretend==1.0.9",
"pytest-cov==2.8.1",
"pytest-httpx",
diff --git a/tests/conftest.py b/tests/conftest.py
index 64c9bf95..4bd41de0 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2,10 +2,6 @@
import pytest
-# Don't try to test asyncio since it is py3 only syntax
-if sys.version_info < (3, 5):
- collect_ignore = ["test_asyncio_transport.py"]
-
pytest.register_assert_rewrite("tests.utils")
diff --git a/tests/test_main.py b/tests/test_main.py
index bffc7230..f4504820 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -1,4 +1,5 @@
-from mock import patch
+from unittest.mock import patch
+
from pretend import stub
from zeep import __main__, client

View File

@@ -1,3 +1,25 @@
-------------------------------------------------------------------
Fri Dec 15 06:34:59 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 4.2.1:
* Fix error regarding closing session in async transport (#1347)
* Drop support for Python 3.6
* Allow embedding CDATA elements in simple types (#1339)
* Allow to pass in a pre parsed Document (#1330)
* Fix httpx DeprecationWarning for post data (#1326)
* Add BinaryMemorySignature (#1300)
* Fix IndexError when empty body response (#1287)
* Add support for context manager on Client (#1166)
* Allow Ws Addressing plugin to use a different URL (#1328)
* Accept strings for xsd base64Binary (#1072)
- Drop patches httpx-test.patch, python-zeep-no-mock.patch:
* Included upstream.
- Add patch xfail-network-tests.patch:
* XFAIL, rather than FAIL tests that require a network connection.
- Switch to autosetup and pyproject macros.
- BuildRequire xmlsec unilaterally and install the openssl library.
- No longer ignore some test files
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jun 8 21:55:35 UTC 2022 - Ben Greiner <code@bnavigator.de> Wed Jun 8 21:55:35 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-zeep # spec file for package python-zeep
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -18,17 +18,17 @@
%define skip_python2 1 %define skip_python2 1
Name: python-zeep Name: python-zeep
Version: 4.1.0 Version: 4.2.1
Release: 0 Release: 0
Summary: A Python SOAP client based on lxml/requests Summary: A Python SOAP client based on lxml/requests
License: MIT License: MIT
Group: Development/Languages/Python
URL: http://docs.python-zeep.org URL: http://docs.python-zeep.org
Source: https://files.pythonhosted.org/packages/source/z/zeep/zeep-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/z/zeep/zeep-%{version}.tar.gz
Patch1: httpx-test.patch # PATCH-FIX-OPENSUSE xfail tests that require network access
# https://github.com/mvantellingen/python-zeep/commit/1ddd118956870f9c68a24c9494207dc17441b416 Patch0: xfail-network-tests.patch
Patch2: python-zeep-no-mock.patch BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-attrs >= 17.2.0 Requires: python-attrs >= 17.2.0
@@ -60,8 +60,8 @@ BuildRequires: %{python_module requests >= 2.7.0}
BuildRequires: %{python_module requests-file >= 1.5.1} BuildRequires: %{python_module requests-file >= 1.5.1}
BuildRequires: %{python_module requests-mock >= 0.7.0} BuildRequires: %{python_module requests-mock >= 0.7.0}
BuildRequires: %{python_module requests-toolbelt >= 0.7.1} BuildRequires: %{python_module requests-toolbelt >= 0.7.1}
# gh#mehcode/python-xmlsec#204 BuildRequires: %{python_module xmlsec >= 0.6.1}
BuildRequires: %{python_module xmlsec >= 0.6.1 if %python-base < 3.10} BuildRequires: libxmlsec1-openssl1
# /SECTION # /SECTION
%python_subpackages %python_subpackages
@@ -69,28 +69,23 @@ BuildRequires: %{python_module xmlsec >= 0.6.1 if %python-base < 3.10}
Python SOAP client based on python-lxml and python-requests Python SOAP client based on python-lxml and python-requests
%prep %prep
%setup -q -n zeep-%{version} %autosetup -p1 -n zeep-%{version}
%autopatch -p1
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
# broken tests %pytest tests
ignorefiles="--ignore tests/test_wsse_signature.py \
--ignore tests/test_wsse_username.py \
--ignore tests/test_wsse_utils.py"
%pytest tests/ ${$python_ignore} $ignorefiles
%files %{python_files} %files %{python_files}
%doc CHANGES README.rst %doc CHANGES README.rst
%license LICENSE %license LICENSE
%{python_sitelib}/zeep %{python_sitelib}/zeep
%{python_sitelib}/zeep-%{version}*-info %{python_sitelib}/zeep-%{version}.dist-info
%changelog %changelog

13
xfail-network-tests.patch Normal file
View File

@@ -0,0 +1,13 @@
Index: zeep-4.2.1/tests/conftest.py
===================================================================
--- zeep-4.2.1.orig/tests/conftest.py
+++ zeep-4.2.1/tests/conftest.py
@@ -11,7 +11,7 @@ def no_requests(request, monkeypatch):
return
def func(*args, **kwargs):
- pytest.fail("External connections not allowed during tests.")
+ pytest.xfail("External connections not allowed during tests.")
monkeypatch.setattr("socket.socket", func)

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5867f2eadd6b028d9751f4155af590d3aaf9280e3a0ed5e15a53343921c956e5
size 160333

3
zeep-4.2.1.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:72093acfdb1d8360ed400869b73fbf1882b95c4287f798084c42ee0c1ff0e425
size 161072