diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_options.py | 11 |
1 files changed, 11 insertions, 0 deletions
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") |