diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2017-03-09 13:52:58 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2017-03-14 08:32:19 +1300 |
commit | 0c6663d0d5335e666598807c2e5d8f105803eac0 (patch) | |
tree | e6782b2e102aca959ad6e30739f816dbad89cbb9 /test/mitmproxy/test_addonmanager.py | |
parent | ee65894d40f5a9f73125a8d3e73ba50540939e5b (diff) | |
download | mitmproxy-0c6663d0d5335e666598807c2e5d8f105803eac0.tar.gz mitmproxy-0c6663d0d5335e666598807c2e5d8f105803eac0.tar.bz2 mitmproxy-0c6663d0d5335e666598807c2e5d8f105803eac0.zip |
Enable custom options for addons
- Add an options parameter to the start() event. This is to be used by addons
on startup to add custom options.
- Add a running() event that is called once the proxy is up and running.
- With the new paradigm we can't log during master __init__, so add a tiny
termstatus addon to print proxy status to terminal once we're running.
Diffstat (limited to 'test/mitmproxy/test_addonmanager.py')
-rw-r--r-- | test/mitmproxy/test_addonmanager.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/mitmproxy/test_addonmanager.py b/test/mitmproxy/test_addonmanager.py index 17402e26..3e5f71c6 100644 --- a/test/mitmproxy/test_addonmanager.py +++ b/test/mitmproxy/test_addonmanager.py @@ -10,12 +10,12 @@ from mitmproxy import proxy class TAddon: def __init__(self, name): self.name = name - self.noop_member = True + self.tick = True def __repr__(self): return "Addon(%s)" % self.name - def noop(self): + def done(self): pass @@ -30,6 +30,6 @@ def test_simple(): assert not a.chain a.add(TAddon("one")) - a("noop") + a("done") with pytest.raises(exceptions.AddonError): - a("noop_member") + a("tick") |