diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-07-18 11:29:18 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-18 11:29:18 +1200 |
commit | 9869cb617ec4f0dd1da5a96727656e5913a1bdd1 (patch) | |
tree | 89193654d2e7e899c392e347bfd94389b82fb267 /test | |
parent | 7b57c2948eb5bdfc5e1704e30fdd12e721f345ea (diff) | |
parent | e9865800a8d7c4c9829a67294616da5fcbd1c2c4 (diff) | |
download | mitmproxy-9869cb617ec4f0dd1da5a96727656e5913a1bdd1.tar.gz mitmproxy-9869cb617ec4f0dd1da5a96727656e5913a1bdd1.tar.bz2 mitmproxy-9869cb617ec4f0dd1da5a96727656e5913a1bdd1.zip |
Merge pull request #1378 from cortesi/cleanups
Console-related cleanups
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") |