forked from pool/python-softlayer-zeep
- Add skip-networked-test.patch to fix
gh#mvantellingen/python-zeep#1402 skipping tests requiring network connection OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-softlayer-zeep?expand=0&rev=8
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 19 13:34:00 UTC 2023 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Add skip-networked-test.patch to fix
|
||||
gh#mvantellingen/python-zeep#1402 skipping tests requiring
|
||||
network connection
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jul 1 09:08:59 UTC 2023 - ecsos <ecsos@opensuse.org>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-softlayer-zeep
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,7 +16,6 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python3-%{**}}
|
||||
%global skip_python2 1
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-softlayer-zeep
|
||||
@@ -24,10 +23,27 @@ Version: 5.0.0
|
||||
Release: 0
|
||||
Summary: A modern/fast Python SOAP client based on lxml / requests
|
||||
License: MIT
|
||||
#Git-Clone: https://github.com/mvantellingen/python-zeep
|
||||
URL: https://docs.python-zeep.org
|
||||
Source: https://files.pythonhosted.org/packages/source/s/softlayer-zeep/softlayer-zeep-%{version}.tar.gz
|
||||
BuildRequires: %{python_module setuptools}
|
||||
# PATCH-FIX-UPSTREAM skip-networked-test.patch gh#mvantellingen/python-zeep#1402 mcepl@suse.com
|
||||
# skip tests requiring network connection
|
||||
Patch0: skip-networked-test.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-attrs >= 17.2.0
|
||||
Requires: python-isodate >= 0.5.4
|
||||
Requires: python-lxml >= 4.6.0
|
||||
Requires: python-platformdirs >= 1.4.0
|
||||
Requires: python-pytz
|
||||
Requires: python-requests >= 2.7.0
|
||||
Requires: python-requests-file >= 1.5.1
|
||||
Requires: python-requests-toolbelt >= 0.7.1
|
||||
Provides: python-zeep = %{version}
|
||||
Obsoletes: python-zeep < %{version}
|
||||
BuildArch: noarch
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module attrs >= 17.2.0}
|
||||
BuildRequires: %{python_module freezegun >= 0.3.15}
|
||||
@@ -45,39 +61,28 @@ BuildRequires: %{python_module requests-file >= 1.5.1}
|
||||
BuildRequires: %{python_module requests-mock >= 0.7.0}
|
||||
BuildRequires: %{python_module requests-toolbelt >= 0.7.1}
|
||||
# /SECTION
|
||||
BuildRequires: fdupes
|
||||
Requires: python-attrs >= 17.2.0
|
||||
Requires: python-isodate >= 0.5.4
|
||||
Requires: python-lxml >= 4.6.0
|
||||
Requires: python-platformdirs >= 1.4.0
|
||||
Requires: python-pytz
|
||||
Requires: python-requests >= 2.7.0
|
||||
Requires: python-requests-file >= 1.5.1
|
||||
Requires: python-requests-toolbelt >= 0.7.1
|
||||
Provides: python-zeep = %version
|
||||
Obsoletes: python-zeep < %version
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
A modern/fast Python SOAP client based on lxml / requests
|
||||
|
||||
%prep
|
||||
%setup -q -n softlayer-zeep-%{version}
|
||||
%autosetup -p1 -n softlayer-zeep-%{version}
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
%pytest
|
||||
%pytest -k 'not network'
|
||||
|
||||
%files %{python_files}
|
||||
%doc CHANGES README.rst
|
||||
%license LICENSE
|
||||
%{python_sitelib}/*
|
||||
%{python_sitelib}/zeep
|
||||
%{python_sitelib}/softlayer_zeep-%{version}*-info
|
||||
|
||||
%changelog
|
||||
|
76
skip-networked-test.patch
Normal file
76
skip-networked-test.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
pyproject.toml | 3 ++-
|
||||
tests/test_cache.py | 4 ++++
|
||||
tests/test_wsse_username.py | 3 +++
|
||||
3 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -28,5 +28,6 @@ testpaths = [
|
||||
]
|
||||
markers = [
|
||||
# mark a test to allow socket usage
|
||||
- "requests"
|
||||
+ "requests",
|
||||
+ "network: test case requires network connection",
|
||||
]
|
||||
--- a/tests/test_cache.py
|
||||
+++ b/tests/test_cache.py
|
||||
@@ -35,6 +35,7 @@ class TestSqliteCache:
|
||||
result = c.get("http://tests.python-zeep.org/example.wsdl")
|
||||
assert result is None
|
||||
|
||||
+ @pytest.mark.network
|
||||
def test_has_expired(self, tmpdir):
|
||||
c = cache.SqliteCache(path=tmpdir.join("sqlite.cache.db").strpath)
|
||||
c.add("http://tests.python-zeep.org/example.wsdl", b"content")
|
||||
@@ -51,6 +52,7 @@ class TestSqliteCache:
|
||||
assert result == b"content"
|
||||
|
||||
|
||||
+@pytest.mark.network
|
||||
def test_memory_cache_timeout(tmpdir):
|
||||
c = cache.InMemoryCache()
|
||||
c.add("http://tests.python-zeep.org/example.wsdl", b"content")
|
||||
@@ -76,6 +78,7 @@ class TestIsExpired:
|
||||
def test_timeout_none(self):
|
||||
assert cache._is_expired(100, None) is False
|
||||
|
||||
+ @pytest.mark.network
|
||||
def test_has_expired(self):
|
||||
timeout = 7200
|
||||
utcnow = datetime.datetime.utcnow()
|
||||
@@ -83,6 +86,7 @@ class TestIsExpired:
|
||||
with freezegun.freeze_time(utcnow):
|
||||
assert cache._is_expired(value, timeout) is False
|
||||
|
||||
+ @pytest.mark.network
|
||||
def test_has_not_expired(self):
|
||||
timeout = 7200
|
||||
utcnow = datetime.datetime.utcnow()
|
||||
--- a/tests/test_wsse_username.py
|
||||
+++ b/tests/test_wsse_username.py
|
||||
@@ -85,6 +85,7 @@ def test_password_text():
|
||||
assert_nodes_equal(envelope, expected)
|
||||
|
||||
|
||||
+@pytest.mark.network
|
||||
@freeze_time("2016-05-08 12:00:00")
|
||||
def test_password_digest(monkeypatch):
|
||||
monkeypatch.setattr(os, "urandom", lambda x: b"mocked-random")
|
||||
@@ -138,6 +139,7 @@ def test_password_digest(monkeypatch):
|
||||
assert_nodes_equal(envelope, expected)
|
||||
|
||||
|
||||
+@pytest.mark.network
|
||||
@freeze_time("2016-05-08 12:00:00")
|
||||
def test_password_digest_custom(monkeypatch):
|
||||
monkeypatch.setattr(os, "urandom", lambda x: b"mocked-random")
|
||||
@@ -323,6 +325,7 @@ def test_timestamp_token():
|
||||
assert_nodes_equal(envelope, expected)
|
||||
|
||||
|
||||
+@pytest.mark.network
|
||||
@freeze_time("2016-05-08 12:00:00")
|
||||
def test_bytes_like_password_digest(monkeypatch):
|
||||
monkeypatch.setattr(os, "urandom", lambda x: b"mocked-random")
|
Reference in New Issue
Block a user