diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2017-01-31 10:57:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-31 10:57:22 +0100 |
commit | ff379b7665d6e28c30ac48ccdae9d611e38dddef (patch) | |
tree | 2a2d6496f15113812e433bc9a00eb54a2461e08f /test | |
parent | 1523068b03fe9ca5eb0512b11b4acf5e8efa9773 (diff) | |
download | mitmproxy-ff379b7665d6e28c30ac48ccdae9d611e38dddef.tar.gz mitmproxy-ff379b7665d6e28c30ac48ccdae9d611e38dddef.tar.bz2 mitmproxy-ff379b7665d6e28c30ac48ccdae9d611e38dddef.zip |
fully test addonmanager (#1970)
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") |