mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 10:26:23 +00:00
fix tests
This commit is contained in:
parent
77eca7c305
commit
5f159da488
@ -12,11 +12,8 @@ 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(
|
with tutils.raises(requests.ConnectionError):
|
||||||
"Connection aborted",
|
requests.get("http://localhost:%s/p/202:da" % d.port)
|
||||||
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)
|
||||||
@ -27,11 +24,8 @@ class TestDaemonManual:
|
|||||||
assert rsp.ok
|
assert rsp.ok
|
||||||
assert rsp.status_code == 202
|
assert rsp.status_code == 202
|
||||||
d.shutdown()
|
d.shutdown()
|
||||||
tutils.raises(
|
with tutils.raises(requests.ConnectionError):
|
||||||
"Connection aborted",
|
requests.get("http://localhost:%s/p/202:da" % d.port)
|
||||||
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(
|
||||||
@ -47,8 +41,5 @@ class TestDaemonManual:
|
|||||||
assert rsp.ok
|
assert rsp.ok
|
||||||
assert rsp.status_code == 202
|
assert rsp.status_code == 202
|
||||||
d.shutdown()
|
d.shutdown()
|
||||||
tutils.raises(
|
with tutils.raises(requests.ConnectionError):
|
||||||
"Connection aborted",
|
requests.get("http://localhost:%s/p/202:da" % d.port)
|
||||||
requests.get,
|
|
||||||
"http://localhost:%s/p/202:da" % d.port
|
|
||||||
)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user