diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-06-01 09:58:01 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-06-01 09:58:01 +1200 |
commit | a061e4587772f4a87eb43d84f2ed358f7cc98fbd (patch) | |
tree | 1aba05c9d0d6f654fe946897dcb8b5d9127a3de2 /test/netlib/http/test_headers.py | |
parent | 06703542037d1c84b0dcb60c6d1c500a0d189e93 (diff) | |
parent | a7abf8b731658b4e7ed8705f7a94a6a62f08d51d (diff) | |
download | mitmproxy-a061e4587772f4a87eb43d84f2ed358f7cc98fbd.tar.gz mitmproxy-a061e4587772f4a87eb43d84f2ed358f7cc98fbd.tar.bz2 mitmproxy-a061e4587772f4a87eb43d84f2ed358f7cc98fbd.zip |
Merge branch 'master' of github.com:cortesi/mitmproxy
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'}) |