structio/tests/httpcore_test.py

16 lines
454 B
Python

import httpcore
import structio
async def main():
# Note: this test only works because we have our own version of httpcore that
# implements a structio-compatible backend. It's just an example anyway
pool = httpcore.AsyncConnectionPool()
http = await pool.request("GET", "http://example.com")
https = await pool.request("GET", "https://example.com")
assert http.status == 200
assert https.status == 200
structio.run(main)