Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit d094d5c

Browse files
committed
Basic HTTP/1.1 release test.
1 parent cb61a31 commit d094d5c

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

test_release.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import logging
1313
import random
1414
import requests
15-
from hyper import HTTP20Connection
15+
from hyper import HTTP20Connection, HTTP11Connection
1616
from hyper.contrib import HTTP20Adapter
1717

1818
logging.basicConfig(level=logging.INFO)
@@ -87,3 +87,26 @@ def test_hitting_twitter(self):
8787
# Confirm all is well.
8888
assert all(map(lambda r: r.status_code == 200, responses))
8989
assert all(map(lambda r: r.text, responses))
90+
91+
def test_hitting_http2bin_org_http11(self):
92+
"""
93+
This test function uses hyper's HTTP/1.1 support to talk to http2bin
94+
"""
95+
c = HTTP11Connection('http2bin.org')
96+
97+
# Here are some nice URLs.
98+
urls = [
99+
'/',
100+
'/ip',
101+
'/user-agent',
102+
'/headers',
103+
'/get',
104+
]
105+
106+
# Go get everything.
107+
for url in urls:
108+
c.request('GET', url)
109+
resp = c.get_response()
110+
111+
assert resp.status == 200
112+
assert resp.read()

0 commit comments

Comments
 (0)