diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-05-31 19:07:55 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-05-31 19:07:55 +1200 |
commit | ec34cae6181d6af0150ac730d70b96104a07e9d5 (patch) | |
tree | 875987f36e83f92ce9a38cd6e22326a948f29609 /test/netlib/http/test_headers.py | |
parent | 15b2374ef9d6a8cbafdff7c79694921387836ff3 (diff) | |
download | mitmproxy-ec34cae6181d6af0150ac730d70b96104a07e9d5.tar.gz mitmproxy-ec34cae6181d6af0150ac730d70b96104a07e9d5.tar.bz2 mitmproxy-ec34cae6181d6af0150ac730d70b96104a07e9d5.zip |
utils.multipartdecode -> http.multipart.decode
also
utils.parse_content_type -> http.headers.parse_content_type
Diffstat (limited to 'test/netlib/http/test_headers.py')
-rw-r--r-- | test/netlib/http/test_headers.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/netlib/http/test_headers.py b/test/netlib/http/test_headers.py index cd2ca9d1..e12bceaf 100644 --- a/test/netlib/http/test_headers.py +++ b/test/netlib/http/test_headers.py @@ -1,4 +1,5 @@ from netlib.http import Headers +from netlib.http.headers import parse_content_type from netlib.tutils import raises @@ -72,3 +73,12 @@ class TestHeaders(object): replacements = headers.replace(r"Host: ", "X-Host ") assert replacements == 0 assert headers["Host"] == "example.com" + + +def test_parse_content_type(): + p = parse_content_type + assert p("text/html") == ("text", "html", {}) + assert p("text") is None + + v = p("text/html; charset=UTF-8") + assert v == ('text', 'html', {'charset': 'UTF-8'}) |