aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_stickycookie.py16
-rw-r--r--test/mitmproxy/addons/test_streambodies.py2
2 files changed, 9 insertions, 9 deletions
diff --git a/test/mitmproxy/addons/test_stickycookie.py b/test/mitmproxy/addons/test_stickycookie.py
index f77d019d..4493e9cc 100644
--- a/test/mitmproxy/addons/test_stickycookie.py
+++ b/test/mitmproxy/addons/test_stickycookie.py
@@ -15,7 +15,7 @@ def test_domain_match():
class TestStickyCookie:
def test_config(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
with pytest.raises(Exception, match="invalid filter"):
tctx.configure(sc, stickycookie="~b")
@@ -26,7 +26,7 @@ class TestStickyCookie:
def test_simple(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
tctx.configure(sc, stickycookie=".*")
f = tflow.tflow(resp=True)
f.response.headers["set-cookie"] = "foo=bar"
@@ -50,7 +50,7 @@ class TestStickyCookie:
def test_response(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
tctx.configure(sc, stickycookie=".*")
c = "SSID=mooo; domain=.google.com, FOO=bar; Domain=.google.com; Path=/; " \
@@ -68,7 +68,7 @@ class TestStickyCookie:
def test_response_multiple(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
tctx.configure(sc, stickycookie=".*")
# Test setting of multiple cookies
@@ -82,7 +82,7 @@ class TestStickyCookie:
def test_response_weird(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
tctx.configure(sc, stickycookie=".*")
# Test setting of weird cookie keys
@@ -100,7 +100,7 @@ class TestStickyCookie:
def test_response_overwrite(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
tctx.configure(sc, stickycookie=".*")
# Test overwriting of a cookie value
@@ -115,7 +115,7 @@ class TestStickyCookie:
def test_response_delete(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
tctx.configure(sc, stickycookie=".*")
# Test that a cookie is be deleted
@@ -127,7 +127,7 @@ class TestStickyCookie:
def test_request(self):
sc = stickycookie.StickyCookie()
- with taddons.context() as tctx:
+ with taddons.context(sc) as tctx:
tctx.configure(sc, stickycookie=".*")
f = self._response(sc, "SSID=mooo", "www.google.com")
diff --git a/test/mitmproxy/addons/test_streambodies.py b/test/mitmproxy/addons/test_streambodies.py
index 426ec9ae..b980ea0b 100644
--- a/test/mitmproxy/addons/test_streambodies.py
+++ b/test/mitmproxy/addons/test_streambodies.py
@@ -7,7 +7,7 @@ import pytest
def test_simple():
sa = streambodies.StreamBodies()
- with taddons.context() as tctx:
+ with taddons.context(sa) as tctx:
with pytest.raises(exceptions.OptionsError):
tctx.configure(sa, stream_large_bodies = "invalid")
tctx.configure(sa, stream_large_bodies = "10")