aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_protocol_http.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-05-31 01:51:31 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-05-31 01:51:31 +0200
commitec92fca8c030fe5971a034a658033f70965b990a (patch)
treeef9a2049eeab539d13e1f9662fd51220ab4ee817 /test/test_protocol_http.py
parent0f8e8ee1ad667c8d747d5876f9b630ecbc01d7e9 (diff)
parenta05a70d8168a07c92b2a3ecbbb1958d85532efe3 (diff)
downloadmitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.tar.gz
mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.tar.bz2
mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.zip
Merge branch 'master' of github.com:mitmproxy/mitmproxy
Diffstat (limited to 'test/test_protocol_http.py')
-rw-r--r--test/test_protocol_http.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py
index c39f9abb..884a528e 100644
--- a/test/test_protocol_http.py
+++ b/test/test_protocol_http.py
@@ -61,7 +61,8 @@ class TestHTTPRequest:
assert "Host" in r.headers
def test_expect_header(self):
- s = StringIO("GET / HTTP/1.1\r\nContent-Length: 3\r\nExpect: 100-continue\r\n\r\nfoobar")
+ s = StringIO(
+ "GET / HTTP/1.1\r\nContent-Length: 3\r\nExpect: 100-continue\r\n\r\nfoobar")
w = StringIO()
r = HTTPRequest.from_stream(s, wfile=w)
assert w.getvalue() == "HTTP/1.1 100 Continue\r\n\r\n"
@@ -84,7 +85,8 @@ class TestHTTPRequest:
tutils.raises("Bad HTTP request line", HTTPRequest.from_stream, s)
s = StringIO("GET http://address:22/ HTTP/1.1")
r = HTTPRequest.from_stream(s)
- assert r.assemble() == "GET http://address:22/ HTTP/1.1\r\nHost: address:22\r\nContent-Length: 0\r\n\r\n"
+ assert r.assemble(
+ ) == "GET http://address:22/ HTTP/1.1\r\nHost: address:22\r\nContent-Length: 0\r\n\r\n"
def test_http_options_relative_form_in(self):
"""
@@ -105,10 +107,10 @@ class TestHTTPRequest:
r.host = 'address'
r.port = 80
r.scheme = "http"
- assert r.assemble() == ("OPTIONS http://address:80/secret/resource HTTP/1.1\r\n"
- "Host: address\r\n"
- "Content-Length: 0\r\n\r\n")
-
+ assert r.assemble() == (
+ "OPTIONS http://address:80/secret/resource HTTP/1.1\r\n"
+ "Host: address\r\n"
+ "Content-Length: 0\r\n\r\n")
def test_assemble_unknown_form(self):
r = tutils.treq()
@@ -257,7 +259,8 @@ class TestHTTPResponse:
def test_get_cookies_with_parameters(self):
h = odict.ODictCaseless()
- h["Set-Cookie"] = ["cookiename=cookievalue;domain=example.com;expires=Wed Oct 21 16:29:41 2015;path=/; HttpOnly"]
+ h["Set-Cookie"] = [
+ "cookiename=cookievalue;domain=example.com;expires=Wed Oct 21 16:29:41 2015;path=/; HttpOnly"]
resp = tutils.tresp()
resp.headers = h
result = resp.get_cookies()