Use Hypercorn for republisher serve
This commit is contained in:
parent
73617cd40c
commit
c04efeb189
7 changed files with 133 additions and 9 deletions
|
|
@ -548,6 +548,30 @@ def test_render_stream_uses_view_transition_for_queue_reorders() -> None:
|
|||
asyncio.run(run())
|
||||
|
||||
|
||||
def test_render_stream_stops_when_shutdown_is_requested() -> None:
|
||||
async def run() -> None:
|
||||
queue = RefreshBroker().subscribe()
|
||||
shutdown_event = asyncio.Event()
|
||||
|
||||
async def render() -> str:
|
||||
return '<main id="morph">queue</main>'
|
||||
|
||||
stream = render_stream(
|
||||
queue,
|
||||
render,
|
||||
render_on_connect=False,
|
||||
shutdown_event=shutdown_event,
|
||||
)
|
||||
next_event = asyncio.create_task(anext(stream))
|
||||
await asyncio.sleep(0)
|
||||
shutdown_event.set()
|
||||
|
||||
with pytest.raises(StopAsyncIteration):
|
||||
await asyncio.wait_for(next_event, timeout=1)
|
||||
|
||||
await stream.aclose()
|
||||
|
||||
asyncio.run(run())
|
||||
def test_render_dashboard_shows_dashboard_information_architecture(
|
||||
monkeypatch, tmp_path: Path
|
||||
) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue