python-urllib3/tests/smoke/test.py
Braňo Náter 86043638bc Add a smoke test
Upstreamed from rhel's Sanity/smoke

Commit hash: a3e2fcfaef1fe4ffa257bdc21d535c9cdc35cafd
Only the test file was kept.
2024-09-16 09:12:59 +02:00

10 lines
264 B
Python

import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://example.com/')
print('status = {0}'.format(r.status))
print("headers['server'] = {0}".format(r.headers['server']))
print(r.data)
if r.status != 200 or not r.data:
raise SystemExit(1)