mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-31 15:28:50 +00:00
fix tests to be compatible with the latest requests version
This commit is contained in:
parent
534c66644f
commit
e9a838ae53
@ -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
|
2
setup.py
2
setup.py
@ -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"]
|
||||
)
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user