aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/http/test_headers.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-05-18 18:46:42 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-05-18 18:46:42 -0700
commit44ac64aa7235362acbb96e0f12aa27534580e575 (patch)
treec03b8c3519c273a4f42b60cb2bce8cc0dd524925 /test/netlib/http/test_headers.py
parent4c3fb8f5097fad2c5de96104dae3f8026b0b4666 (diff)
downloadmitmproxy-44ac64aa7235362acbb96e0f12aa27534580e575.tar.gz
mitmproxy-44ac64aa7235362acbb96e0f12aa27534580e575.tar.bz2
mitmproxy-44ac64aa7235362acbb96e0f12aa27534580e575.zip
add MultiDict
This commit introduces MultiDict, a multi-dictionary similar to ODict, but with improved semantics (as in the Headers class). MultiDict fixes a few issues that were present in the Request/Response API. In particular, `request.cookies["foo"] = "bar"` has previously been a no-op, as the cookies property returned a mutable _copy_ of the cookies.
Diffstat (limited to 'test/netlib/http/test_headers.py')
-rw-r--r--test/netlib/http/test_headers.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/netlib/http/test_headers.py b/test/netlib/http/test_headers.py
index 8c1db9dc..48d3b323 100644
--- a/test/netlib/http/test_headers.py
+++ b/test/netlib/http/test_headers.py
@@ -5,10 +5,10 @@ from netlib.tutils import raises
class TestHeaders(object):
def _2host(self):
return Headers(
- [
- [b"Host", b"example.com"],
- [b"host", b"example.org"]
- ]
+ (
+ (b"Host", b"example.com"),
+ (b"host", b"example.org")
+ )
)
def test_init(self):
@@ -38,7 +38,7 @@ class TestHeaders(object):
assert headers["Host"] == "example.com"
assert headers["Accept"] == "text/plain"
- with raises(ValueError):
+ with raises(TypeError):
Headers([[b"Host", u"not-bytes"]])
def test_getitem(self):