Mercurial > code > home > repos > rdferry
comparison examples/serve_custom_root_page_test.py @ 8:25538e3ee531
rename
author | drewp@bigasterisk.com |
---|---|
date | Sat, 16 Mar 2024 12:51:39 -0700 |
parents | b34cd6619316 |
children |
comparison
equal
deleted
inserted
replaced
7:d98cb018fad7 | 8:25538e3ee531 |
---|---|
1 from pathlib import Path | 1 from pathlib import Path |
2 | 2 |
3 import pytest | 3 import pytest |
4 | 4 |
5 from examples.run_server_make_request import HttpServer | 5 from examples._run_server_child import RunHttpServerChildProcess |
6 | 6 |
7 | 7 |
8 @pytest.mark.asyncio | 8 @pytest.mark.asyncio |
9 async def test_http_request_to_subprocess(): | 9 async def test_http_request_to_subprocess(): |
10 async with HttpServer( | 10 async with RunHttpServerChildProcess( |
11 Path('examples/serve_custom_root_page.py')) as http_server: | 11 Path('examples/serve_custom_root_page.py')) as http_server: |
12 response = await http_server.get('http://localhost:8005/') | 12 response = await http_server.get('http://localhost:8005/') |
13 assert (await response.text()) == 'hello world' | 13 assert (await response.text()) == 'hello world' |