2024-03-10 19:37:12 +01:00
|
|
|
import httpcore
|
|
|
|
import structio
|
|
|
|
|
2024-03-11 12:17:41 +01:00
|
|
|
|
2024-03-10 19:37:12 +01:00
|
|
|
async def main():
|
2024-03-10 19:53:58 +01:00
|
|
|
# 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
|
2024-03-10 19:37:12 +01:00
|
|
|
pool = httpcore.AsyncConnectionPool()
|
2024-03-23 13:13:29 +01:00
|
|
|
http = await pool.request("GET", "http://example.com")
|
|
|
|
https = await pool.request("GET", "https://example.com")
|
|
|
|
assert http.status == 200
|
|
|
|
assert https.status == 200
|
2024-03-10 19:37:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
structio.run(main)
|