diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_flow.py | 8 | ||||
-rw-r--r-- | test/mitmproxy/test_options.py | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py index 03935c16..90f7f915 100644 --- a/test/mitmproxy/test_flow.py +++ b/test/mitmproxy/test_flow.py @@ -751,7 +751,11 @@ class TestFlowMaster: f = tutils.tflow(resp=True) pb = [tutils.tflow(resp=True), f] - fm = flow.FlowMaster(None, DummyServer(ProxyConfig()), s) + fm = flow.FlowMaster( + flow.options.Options(), + DummyServer(ProxyConfig()), + s + ) assert not fm.start_server_playback( pb, False, @@ -779,7 +783,7 @@ class TestFlowMaster: f.response = HTTPResponse.wrap(netlib.tutils.tresp(content=f.request)) pb = [f] - fm = flow.FlowMaster(None, None, s) + fm = flow.FlowMaster(flow.options.Options(), None, s) fm.refresh_server_playback = True assert not fm.do_server_playback(tutils.tflow()) diff --git a/test/mitmproxy/test_options.py b/test/mitmproxy/test_options.py index cdb0d765..af619b27 100644 --- a/test/mitmproxy/test_options.py +++ b/test/mitmproxy/test_options.py @@ -52,6 +52,17 @@ def test_setter(): o.setter("nonexistent") +def test_toggler(): + o = TO(two=True) + f = o.toggler("two") + f() + assert o.two is False + f() + assert o.two is True + with tutils.raises("no such option"): + o.toggler("nonexistent") + + def test_rollback(): o = TO(one="two") |