forked from pool/python-geventhttpclient
- Add patch to skip online tests:
* gevent-mark-tests.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geventhttpclient?expand=0&rev=4
This commit is contained in:
committed by
Git OBS Bridge
parent
b1553fff10
commit
9a7ed02263
64
gevent-mark-tests.patch
Normal file
64
gevent-mark-tests.patch
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
Index: geventhttpclient-1.3.1/src/geventhttpclient/tests/test_client.py
|
||||||
|
===================================================================
|
||||||
|
--- geventhttpclient-1.3.1.orig/src/geventhttpclient/tests/test_client.py
|
||||||
|
+++ geventhttpclient-1.3.1/src/geventhttpclient/tests/test_client.py
|
||||||
|
@@ -34,6 +34,7 @@ def wsgiserver(handler):
|
||||||
|
finally:
|
||||||
|
server.stop()
|
||||||
|
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_client_simple():
|
||||||
|
client = HTTPClient('www.google.fr')
|
||||||
|
assert client.port == 80
|
||||||
|
@@ -42,6 +43,7 @@ def test_client_simple():
|
||||||
|
body = response.read()
|
||||||
|
assert len(body)
|
||||||
|
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_client_without_leading_slash():
|
||||||
|
client = HTTPClient('www.google.fr')
|
||||||
|
with client.get("") as response:
|
||||||
|
@@ -50,9 +52,11 @@ def test_client_without_leading_slash():
|
||||||
|
assert(response.status_code in (200, 301, 302))
|
||||||
|
|
||||||
|
test_headers = {'User-Agent': 'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17'}
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_client_with_default_headers():
|
||||||
|
client = HTTPClient.from_url('www.google.fr/', headers=test_headers)
|
||||||
|
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_request_with_headers():
|
||||||
|
client = HTTPClient('www.google.fr')
|
||||||
|
response = client.get('/', headers=test_headers)
|
||||||
|
@@ -77,6 +81,7 @@ def test_build_request_invalid_host():
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
client._build_request('GET', 'http://www.spiegel.de/')
|
||||||
|
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_response_context_manager():
|
||||||
|
client = HTTPClient.from_url('http://www.google.fr/')
|
||||||
|
r = None
|
||||||
|
@@ -89,6 +94,7 @@ def test_response_context_manager():
|
||||||
|
os.environ.get("TRAVIS") == "true",
|
||||||
|
reason="We have issues on travis with the SSL tests"
|
||||||
|
)
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_client_ssl():
|
||||||
|
client = HTTPClient('www.google.fr', ssl=True)
|
||||||
|
assert client.port == 443
|
||||||
|
@@ -102,6 +108,7 @@ def test_client_ssl():
|
||||||
|
and os.environ.get("TRAVIS") == "true",
|
||||||
|
reason="We have issues on travis with the SSL tests"
|
||||||
|
)
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_ssl_fail_invalid_certificate():
|
||||||
|
certs = os.path.join(
|
||||||
|
os.path.dirname(os.path.abspath(__file__)), "oncert.pem")
|
||||||
|
@@ -110,6 +117,7 @@ def test_ssl_fail_invalid_certificate():
|
||||||
|
with pytest.raises(SSLError):
|
||||||
|
client.get('/')
|
||||||
|
|
||||||
|
+@pytest.mark.online
|
||||||
|
def test_multi_queries_greenlet_safe():
|
||||||
|
client = HTTPClient('www.google.fr', concurrency=3)
|
||||||
|
group = gevent.pool.Group()
|
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Mar 22 10:03:15 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- Add patch to skip online tests:
|
||||||
|
* gevent-mark-tests.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Mar 14 16:44:36 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
|
Thu Mar 14 16:44:36 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@ Group: Development/Languages/Python
|
|||||||
URL: http://github.com/gwik/geventhttpclient
|
URL: http://github.com/gwik/geventhttpclient
|
||||||
Source: https://files.pythonhosted.org/packages/source/g/geventhttpclient/geventhttpclient-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/g/geventhttpclient/geventhttpclient-%{version}.tar.gz
|
||||||
Source1: https://raw.githubusercontent.com/gwik/geventhttpclient/master/LICENSE-MIT
|
Source1: https://raw.githubusercontent.com/gwik/geventhttpclient/master/LICENSE-MIT
|
||||||
|
Patch0: gevent-mark-tests.patch
|
||||||
BuildRequires: %{python_module certifi}
|
BuildRequires: %{python_module certifi}
|
||||||
BuildRequires: %{python_module devel}
|
BuildRequires: %{python_module devel}
|
||||||
BuildRequires: %{python_module gevent}
|
BuildRequires: %{python_module gevent}
|
||||||
@@ -53,6 +54,7 @@ APIs like Twitter's.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n geventhttpclient-%{version}
|
%setup -q -n geventhttpclient-%{version}
|
||||||
|
%patch0 -p1
|
||||||
cp %{SOURCE1} .
|
cp %{SOURCE1} .
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@@ -64,15 +66,7 @@ cp %{SOURCE1} .
|
|||||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# online tests:
|
%python_expand PYTHONPATH=$PYTHONPATH:%{buildroot}%{$python_sitearch} $python -mpytest src/geventhttpclient/tests -m 'not online'
|
||||||
# test_client_simple
|
|
||||||
# test_client_without_leading_slash
|
|
||||||
# test_request_with_headers
|
|
||||||
# test_response_context_manager
|
|
||||||
# test_client_ssl
|
|
||||||
# test_ssl_fail_invalid_certificate
|
|
||||||
# test_multi_queries_greenlet_safe
|
|
||||||
%python_expand PYTHONPATH=$PYTHONPATH:%{buildroot}%{$python_sitearch} $python -mpytest src/geventhttpclient/tests -k 'not (test_client_simple or test_client_without_leading_slash or test_request_with_headers or test_response_context_manager or test_client_ssl or test_ssl_fail_invalid_certificate or test_multi_queries_greenlet_safe)'
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE-MIT
|
%license LICENSE-MIT
|
||||||
|
Reference in New Issue
Block a user