mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-01 07:49:10 +00:00
Try to fix test suite race like a savage.
This commit is contained in:
parent
80d191ff7c
commit
fb1b9113a1
@ -147,14 +147,16 @@ class TestDaemon(_TestDaemon):
|
|||||||
def test_timeout(self):
|
def test_timeout(self):
|
||||||
assert "Timeout" in self.tval(["get:'/p/200:p0,10'"], timeout=0.01)
|
assert "Timeout" in self.tval(["get:'/p/200:p0,10'"], timeout=0.01)
|
||||||
assert "HTTP" in self.tval(
|
assert "HTTP" in self.tval(
|
||||||
["get:'/p/200:p5,10'"],
|
["get:'/p/200:p5,100'"],
|
||||||
showresp=True,
|
showresp=True,
|
||||||
timeout=0.01)
|
timeout=0.01
|
||||||
|
)
|
||||||
assert not "HTTP" in self.tval(
|
assert not "HTTP" in self.tval(
|
||||||
["get:'/p/200:p3,10'"],
|
["get:'/p/200:p3,10'"],
|
||||||
showresp=True,
|
showresp=True,
|
||||||
timeout=0.01,
|
timeout=0.01,
|
||||||
ignoretimeout=True)
|
ignoretimeout=True
|
||||||
|
)
|
||||||
|
|
||||||
def test_showresp(self):
|
def test_showresp(self):
|
||||||
reqs = ["get:/api/info:p0,0", "get:/api/info:p0,0"]
|
reqs = ["get:/api/info:p0,0", "get:/api/info:p0,0"]
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import cStringIO
|
import cStringIO
|
||||||
from libpathod import pathod, version
|
from libpathod import pathod, version
|
||||||
from netlib import tcp, http
|
from netlib import tcp, http
|
||||||
|
import time
|
||||||
|
|
||||||
import tutils
|
import tutils
|
||||||
|
|
||||||
|
|
||||||
@ -200,7 +202,8 @@ class CommonTests(tutils.DaemonTests):
|
|||||||
|
|
||||||
def test_websocket_frame(self):
|
def test_websocket_frame(self):
|
||||||
r = self.pathoc(["ws:/p/", "wf:b@10"], ws_read_limit=0)
|
r = self.pathoc(["ws:/p/", "wf:b@10"], ws_read_limit=0)
|
||||||
assert "wsframe" in [i["type"] for i in self.d.log()]
|
time.sleep(0.01)
|
||||||
|
assert self.d.last_log()["type"] == "wsframe"
|
||||||
|
|
||||||
|
|
||||||
class TestDaemon(CommonTests):
|
class TestDaemon(CommonTests):
|
||||||
|
Loading…
Reference in New Issue
Block a user