aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-04-14 16:23:51 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-04-14 16:23:51 +1200
commitc335c2b5330865ccab176c6213db63151383a142 (patch)
tree3dd6029edb0819f906eb91bf580546422d751a2a /test
parentab7e2857cc9095c4cee8ca9b569c16516aa520ba (diff)
downloadmitmproxy-c335c2b5330865ccab176c6213db63151383a142.tar.gz
mitmproxy-c335c2b5330865ccab176c6213db63151383a142.tar.bz2
mitmproxy-c335c2b5330865ccab176c6213db63151383a142.zip
Add set_cookies method to HTTPResponse
Diffstat (limited to 'test')
-rw-r--r--test/test_protocol_http.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py
index 0276cab7..28c63430 100644
--- a/test/test_protocol_http.py
+++ b/test/test_protocol_http.py
@@ -285,6 +285,17 @@ class TestHTTPResponse:
assert "othercookie" in result
assert result["othercookie"][0] == ["othervalue", odict.ODict()]
+ def test_set_cookies(self):
+ h = odict.ODictCaseless()
+ resp = tutils.tresp()
+ v = resp.get_cookies()
+ v.add("foo", ["bar", odict.ODictCaseless()])
+ resp.set_cookies(v)
+
+ v = resp.get_cookies()
+ assert len(v) == 1
+ assert v["foo"] == [["bar", odict.ODictCaseless()]]
+
class TestHTTPFlow(object):