mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
flow.py 100% test coverage
This commit is contained in:
parent
18d25ec1a1
commit
3ef9d2cffc
@ -265,7 +265,7 @@ class uState(libpry.AutoTree):
|
|||||||
e = proxy.Error(tutils.tflow().request, "message")
|
e = proxy.Error(tutils.tflow().request, "message")
|
||||||
assert not c.add_error(e)
|
assert not c.add_error(e)
|
||||||
|
|
||||||
def test_view(self):
|
def test_set_limit(self):
|
||||||
c = flow.State()
|
c = flow.State()
|
||||||
|
|
||||||
req = tutils.treq()
|
req = tutils.treq()
|
||||||
@ -292,6 +292,16 @@ class uState(libpry.AutoTree):
|
|||||||
c.set_limit("~s")
|
c.set_limit("~s")
|
||||||
assert len(c.view) == 1
|
assert len(c.view) == 1
|
||||||
|
|
||||||
|
assert "Invalid" in c.set_limit("~")
|
||||||
|
|
||||||
|
def test_set_intercept(self):
|
||||||
|
c = flow.State()
|
||||||
|
assert not c.set_intercept("~q")
|
||||||
|
assert c.intercept_txt == "~q"
|
||||||
|
assert "Invalid" in c.set_intercept("~")
|
||||||
|
assert not c.set_intercept(None)
|
||||||
|
assert c.intercept_txt == None
|
||||||
|
|
||||||
def _add_request(self, state):
|
def _add_request(self, state):
|
||||||
req = tutils.treq()
|
req = tutils.treq()
|
||||||
f = state.add_request(req)
|
f = state.add_request(req)
|
||||||
|
Loading…
Reference in New Issue
Block a user