aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-07-08 09:20:25 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-07-22 15:30:50 +0200
commit6dcfc35011208f4bfde7f37a63d7b980f6c41ce0 (patch)
tree6478a1b7bf2445419855f0f00415130e87dab7d9 /test
parente316a9cdb44444667e26938f8c1c3969e56c2f0e (diff)
downloadmitmproxy-6dcfc35011208f4bfde7f37a63d7b980f6c41ce0.tar.gz
mitmproxy-6dcfc35011208f4bfde7f37a63d7b980f6c41ce0.tar.bz2
mitmproxy-6dcfc35011208f4bfde7f37a63d7b980f6c41ce0.zip
introduce http_semantics module
used for generic HTTP representation everything should apply for HTTP/1 and HTTP/2
Diffstat (limited to 'test')
-rw-r--r--test/test_http.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_http.py b/test/test_http.py
index 2ad81d24..bbc78847 100644
--- a/test/test_http.py
+++ b/test/test_http.py
@@ -1,7 +1,7 @@
import cStringIO
import textwrap
import binascii
-from netlib import http, odict, tcp
+from netlib import http, http_semantics, odict, tcp
from . import tutils, tservers
@@ -307,13 +307,13 @@ def test_read_response():
data = """
HTTP/1.1 200 OK
"""
- assert tst(data, "GET", None) == (
+ assert tst(data, "GET", None) == http_semantics.Response(
(1, 1), 200, 'OK', odict.ODictCaseless(), ''
)
data = """
HTTP/1.1 200
"""
- assert tst(data, "GET", None) == (
+ assert tst(data, "GET", None) == http_semantics.Response(
(1, 1), 200, '', odict.ODictCaseless(), ''
)
data = """
@@ -330,7 +330,7 @@ def test_read_response():
HTTP/1.1 200 OK
"""
- assert tst(data, "GET", None) == (
+ assert tst(data, "GET", None) == http_semantics.Response(
(1, 1), 100, 'CONTINUE', odict.ODictCaseless(), ''
)
@@ -340,8 +340,8 @@ def test_read_response():
foo
"""
- assert tst(data, "GET", None)[4] == 'foo'
- assert tst(data, "HEAD", None)[4] == ''
+ assert tst(data, "GET", None).content == 'foo'
+ assert tst(data, "HEAD", None).content == ''
data = """
HTTP/1.1 200 OK
@@ -357,7 +357,7 @@ def test_read_response():
foo
"""
- assert tst(data, "GET", None, include_body=False)[4] is None
+ assert tst(data, "GET", None, include_body=False).content is None
def test_parse_url():