diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-05-18 18:46:42 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-05-18 18:46:42 -0700 |
commit | 44ac64aa7235362acbb96e0f12aa27534580e575 (patch) | |
tree | c03b8c3519c273a4f42b60cb2bce8cc0dd524925 /test/netlib/http/http2 | |
parent | 4c3fb8f5097fad2c5de96104dae3f8026b0b4666 (diff) | |
download | mitmproxy-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/http2')
-rw-r--r-- | test/netlib/http/http2/test_connections.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/netlib/http/http2/test_connections.py b/test/netlib/http/http2/test_connections.py index 7b003067..7d240c0e 100644 --- a/test/netlib/http/http2/test_connections.py +++ b/test/netlib/http/http2/test_connections.py @@ -312,7 +312,7 @@ class TestReadRequest(tservers.ServerTestBase): req = protocol.read_request(NotImplemented) assert req.stream_id - assert req.headers.fields == [[b':method', b'GET'], [b':path', b'/'], [b':scheme', b'https']] + assert req.headers.fields == ((b':method', b'GET'), (b':path', b'/'), (b':scheme', b'https')) assert req.content == b'foobar' @@ -418,7 +418,7 @@ class TestReadResponse(tservers.ServerTestBase): assert resp.http_version == "HTTP/2.0" assert resp.status_code == 200 assert resp.reason == '' - assert resp.headers.fields == [[b':status', b'200'], [b'etag', b'foobar']] + assert resp.headers.fields == ((b':status', b'200'), (b'etag', b'foobar')) assert resp.content == b'foobar' assert resp.timestamp_end @@ -445,7 +445,7 @@ class TestReadEmptyResponse(tservers.ServerTestBase): assert resp.http_version == "HTTP/2.0" assert resp.status_code == 200 assert resp.reason == '' - assert resp.headers.fields == [[b':status', b'200'], [b'etag', b'foobar']] + assert resp.headers.fields == ((b':status', b'200'), (b'etag', b'foobar')) assert resp.content == b'' |