* gevent-mark-tests.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geventhttpclient?expand=0&rev=4
65 lines
2.4 KiB
Diff
65 lines
2.4 KiB
Diff
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()
|