aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_protocol_http.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_protocol_http.py')
-rw-r--r--test/test_protocol_http.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py
index 23c3f469..c6fad508 100644
--- a/test/test_protocol_http.py
+++ b/test/test_protocol_http.py
@@ -55,6 +55,14 @@ class TestHTTPRequest:
r.update_host_header()
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")
+ w = StringIO()
+ r = HTTPRequest.from_stream(s, wfile=w)
+ assert w.getvalue() == "HTTP/1.1 100 Continue\r\n\r\n"
+ assert r.content == "foo"
+ assert s.read(3) == "bar"
+
def test_authority_form_in(self):
s = StringIO("CONNECT oops-no-port.com HTTP/1.1")
tutils.raises("Bad HTTP request line", HTTPRequest.from_stream, s)