aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/mitmproxy/net/http/test_cookies.py3
-rw-r--r--test/mitmproxy/net/http/test_message.py6
2 files changed, 9 insertions, 0 deletions
diff --git a/test/mitmproxy/net/http/test_cookies.py b/test/mitmproxy/net/http/test_cookies.py
index 680a5033..77549d9e 100644
--- a/test/mitmproxy/net/http/test_cookies.py
+++ b/test/mitmproxy/net/http/test_cookies.py
@@ -269,6 +269,9 @@ def test_refresh_cookie():
c = "MOO=BAR; Expires=Tue, 08-Mar-2011 00:20:38 GMT; Path=foo.com; Secure"
assert "00:21:38" in cookies.refresh_set_cookie_header(c, 60)
+ c = "rfoo=bar; Domain=reddit.com; expires=Thu, 31 Dec 2037; Path=/"
+ assert "expires" not in cookies.refresh_set_cookie_header(c, 60)
+
c = "foo,bar"
with pytest.raises(ValueError):
cookies.refresh_set_cookie_header(c, 60)
diff --git a/test/mitmproxy/net/http/test_message.py b/test/mitmproxy/net/http/test_message.py
index c6036697..512f3199 100644
--- a/test/mitmproxy/net/http/test_message.py
+++ b/test/mitmproxy/net/http/test_message.py
@@ -48,6 +48,12 @@ class TestMessageData:
assert data != 0
+ def test_serializable(self):
+ data1 = tutils.tresp(timestamp_start=42, timestamp_end=42).data
+ data2 = tutils.tresp().data.from_state(data1.get_state()) # ResponseData.from_state()
+
+ assert data1 == data2
+
class TestMessage: