fix tests

This commit is contained in:
Maximilian Hils 2014-09-28 03:55:16 +02:00
parent d4bd2101b5
commit 0426eccfd8
2 changed files with 4 additions and 5 deletions

View File

@ -99,7 +99,7 @@ setup(
], ],
install_requires=[ install_requires=[
'netlib>=%s' % version.MINORVERSION, 'netlib>=%s' % version.MINORVERSION,
"requests>=2.4.0", "requests>=2.4.1",
"Flask>=0.10.1" "Flask>=0.10.1"
], ],
extras_require={ extras_require={

View File

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