diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_addonmanager.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/mitmproxy/test_addonmanager.py b/test/mitmproxy/test_addonmanager.py index 7a50148e..17402e26 100644 --- a/test/mitmproxy/test_addonmanager.py +++ b/test/mitmproxy/test_addonmanager.py @@ -1,4 +1,7 @@ +import pytest + from mitmproxy import addonmanager +from mitmproxy import exceptions from mitmproxy import options from mitmproxy import master from mitmproxy import proxy @@ -7,10 +10,14 @@ from mitmproxy import proxy class TAddon: def __init__(self, name): self.name = name + self.noop_member = True def __repr__(self): return "Addon(%s)" % self.name + def noop(self): + pass + def test_simple(): o = options.Options() @@ -21,3 +28,8 @@ def test_simple(): assert not a.get("two") a.clear() assert not a.chain + + a.add(TAddon("one")) + a("noop") + with pytest.raises(exceptions.AddonError): + a("noop_member") |