fix tests to be compatible with the latest requests version

This commit is contained in:
Maximilian Hils 2014-08-31 01:28:51 +02:00
parent 534c66644f
commit e9a838ae53
3 changed files with 8 additions and 8 deletions

View File

@ -5,5 +5,5 @@ Werkzeug>=0.9.4
itsdangerous>=0.23
pyOpenSSL>=0.13.1
pyasn1>=0.1.7
requests>=2.1.0
requests>=2.4.0
netlib>=0.10

View File

@ -90,5 +90,5 @@ setup(
"Topic :: Software Development :: Testing :: Traffic Generation",
"Topic :: Internet :: WWW/HTTP",
],
install_requires=['netlib>=%s'%version.MINORVERSION, "requests>=1.1.0", "Flask>=0.10.1"]
install_requires=['netlib>=%s'%version.MINORVERSION, "requests>=2.4.0", "Flask>=0.10.1"]
)

View File

@ -1,8 +1,8 @@
import time, logging
import logging
import requests
from libpathod import test, utils
from libpathod import test
import tutils
from requests.packages.urllib3.exceptions import ProtocolError
logging.disable(logging.CRITICAL)
class TestDaemonManual:
@ -11,7 +11,7 @@ class TestDaemonManual:
rsp = requests.get("http://localhost:%s/p/202:da"%d.port)
assert rsp.ok
assert rsp.status_code == 202
tutils.raises(requests.ConnectionError, requests.get, "http://localhost:%s/p/202:da"%d.port)
tutils.raises(ProtocolError, requests.get, "http://localhost:%s/p/202:da"%d.port)
def test_startstop_ssl(self):
d = test.Daemon(ssl=True)
@ -19,7 +19,7 @@ class TestDaemonManual:
assert rsp.ok
assert rsp.status_code == 202
d.shutdown()
tutils.raises(requests.ConnectionError, requests.get, "http://localhost:%s/p/202:da"%d.port)
tutils.raises(ProtocolError, requests.get, "http://localhost:%s/p/202:da"%d.port)
def test_startstop_ssl_explicit(self):
ssloptions = dict(
@ -32,6 +32,6 @@ class TestDaemonManual:
assert rsp.ok
assert rsp.status_code == 202
d.shutdown()
tutils.raises(requests.ConnectionError, requests.get, "http://localhost:%s/p/202:da"%d.port)
tutils.raises(ProtocolError, requests.get, "http://localhost:%s/p/202:da"%d.port)