aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/http
diff options
context:
space:
mode:
Diffstat (limited to 'test/netlib/http')
-rw-r--r--test/netlib/http/test_cookies.py13
-rw-r--r--test/netlib/http/test_request.py2
-rw-r--r--test/netlib/http/test_response.py2
3 files changed, 13 insertions, 4 deletions
diff --git a/test/netlib/http/test_cookies.py b/test/netlib/http/test_cookies.py
index 3b520a44..da28850f 100644
--- a/test/netlib/http/test_cookies.py
+++ b/test/netlib/http/test_cookies.py
@@ -228,7 +228,16 @@ 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 = "foo,bar"
+ with raises(ValueError):
+ cookies.refresh_set_cookie_header(c, 60)
+
# https://github.com/mitmproxy/mitmproxy/issues/773
c = ">=A"
- with raises(ValueError):
- cookies.refresh_set_cookie_header(c, 60) \ No newline at end of file
+ assert cookies.refresh_set_cookie_header(c, 60)
+
+ # https://github.com/mitmproxy/mitmproxy/issues/1118
+ c = "foo:bar=bla"
+ assert cookies.refresh_set_cookie_header(c, 0)
+ c = "foo/bar=bla"
+ assert cookies.refresh_set_cookie_header(c, 0)
diff --git a/test/netlib/http/test_request.py b/test/netlib/http/test_request.py
index 91fd8ce3..ae231a8e 100644
--- a/test/netlib/http/test_request.py
+++ b/test/netlib/http/test_request.py
@@ -172,7 +172,7 @@ class TestRequestUtils(object):
def test_get_cookies_none(self):
request = treq()
request.headers = Headers()
- assert len(request.cookies) == 0
+ assert not request.cookies
def test_get_cookies_single(self):
request = treq()
diff --git a/test/netlib/http/test_response.py b/test/netlib/http/test_response.py
index a0c44d90..5440176c 100644
--- a/test/netlib/http/test_response.py
+++ b/test/netlib/http/test_response.py
@@ -98,7 +98,7 @@ class TestResponseUtils(object):
resp = tresp()
v = resp.cookies
v.add("foo", ["bar", ODictCaseless()])
- resp.set_cookies(v)
+ resp.cookies = v
v = resp.cookies
assert len(v) == 1