view examples/serve_custom_root_page_test.py @ 12:ba73d8ba81dc default tip

refactor
author drewp@bigasterisk.com
date Mon, 18 Mar 2024 16:51:44 -0700
parents 25538e3ee531
children
line wrap: on
line source

from pathlib import Path

import pytest

from examples._run_server_child import RunHttpServerChildProcess


@pytest.mark.asyncio
async def test_http_request_to_subprocess():
    async with RunHttpServerChildProcess(
            Path('examples/serve_custom_root_page.py')) as http_server:
        response = await http_server.get('http://localhost:8005/')
        assert (await response.text()) == 'hello world'