diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/mitmproxy/test_addonmanager.py | 4 | ||||
| -rw-r--r-- | test/mitmproxy/test_examples.py | 8 | ||||
| -rw-r--r-- | test/mitmproxy/tservers.py | 2 | 
3 files changed, 8 insertions, 6 deletions
diff --git a/test/mitmproxy/test_addonmanager.py b/test/mitmproxy/test_addonmanager.py index 3e5f71c6..ef34371f 100644 --- a/test/mitmproxy/test_addonmanager.py +++ b/test/mitmproxy/test_addonmanager.py @@ -30,6 +30,6 @@ def test_simple():      assert not a.chain      a.add(TAddon("one")) -    a("done") +    a.trigger("done")      with pytest.raises(exceptions.AddonError): -        a("tick") +        a.trigger("tick") diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py index f20e0c8c..56692364 100644 --- a/test/mitmproxy/test_examples.py +++ b/test/mitmproxy/test_examples.py @@ -145,7 +145,7 @@ class TestHARDump:          path = str(tmpdir.join("somefile"))          m, sc = tscript("complex/har_dump.py", shlex.quote(path)) -        m.addons.invoke(m, "response", self.flow()) +        m.addons.trigger("response", self.flow())          m.addons.remove(sc)          with open(path, "r") as inp: @@ -156,7 +156,9 @@ class TestHARDump:          path = str(tmpdir.join("somefile"))          m, sc = tscript("complex/har_dump.py", shlex.quote(path)) -        m.addons.invoke(m, "response", self.flow(resp_content=b"foo" + b"\xFF" * 10)) +        m.addons.trigger( +            "response", self.flow(resp_content=b"foo" + b"\xFF" * 10) +        )          m.addons.remove(sc)          with open(path, "r") as inp: @@ -194,7 +196,7 @@ class TestHARDump:          path = str(tmpdir.join("somefile"))          m, sc = tscript("complex/har_dump.py", shlex.quote(path)) -        m.addons.invoke(m, "response", f) +        m.addons.trigger("response", f)          m.addons.remove(sc)          with open(path, "r") as inp: diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py index c47411ee..0f34e37e 100644 --- a/test/mitmproxy/tservers.py +++ b/test/mitmproxy/tservers.py @@ -80,7 +80,7 @@ class TestMaster(master.Master):          self.addons.add(self.state)          self.addons.add(*addons)          self.addons.configure_all(self.options, self.options.keys()) -        self.addons.invoke_all_with_context("running") +        self.addons.trigger("running")      def clear_log(self):          self.tlog = []  | 
