File: aiohttp_with_inject.py

package info (click to toggle)
python-truststore 0.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 236 kB
  • sloc: python: 1,835; makefile: 13; sh: 6
file content (20 lines) | stat: -rw-r--r-- 386 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Used by the test: test_inject.py::test_aiohttp_work_with_inject

import asyncio
import sys

import truststore

truststore.inject_into_ssl()

import aiohttp  # noqa: E402


async def main():
    async with aiohttp.ClientSession() as client:
        resp = await client.get("https://localhost:9999")
        assert resp.status == 200
        sys.exit(resp.status)


asyncio.run(main())