mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Extended intercept tests to include toggle feature
This commit is contained in:
parent
e754fe78cd
commit
f8c5fb3d15
@ -13,10 +13,12 @@ def test_simple():
|
||||
assert not r.filt
|
||||
tctx.configure(r, intercept="~q")
|
||||
assert r.filt
|
||||
assert tctx.options.intercept_active
|
||||
with pytest.raises(exceptions.OptionsError):
|
||||
tctx.configure(r, intercept="~~")
|
||||
tctx.configure(r, intercept=None)
|
||||
assert not r.filt
|
||||
assert not tctx.options.intercept_active
|
||||
|
||||
tctx.configure(r, intercept="~s")
|
||||
|
||||
@ -31,3 +33,13 @@ def test_simple():
|
||||
f = tflow.tflow(resp=True)
|
||||
r.response(f)
|
||||
assert f.intercepted
|
||||
|
||||
tctx.configure(r, intercept_active=False)
|
||||
f = tflow.tflow(resp=True)
|
||||
tctx.cycle(r, f)
|
||||
assert not f.intercepted
|
||||
|
||||
tctx.configure(r, intercept_active=True)
|
||||
f = tflow.tflow(resp=True)
|
||||
tctx.cycle(r, f)
|
||||
assert f.intercepted
|
||||
|
Loading…
Reference in New Issue
Block a user