Большой рефакторинг с кодексом
This commit is contained in:
@@ -36,7 +36,7 @@ def test_control_channel_can_stop_manager(tmp_path):
|
||||
cfg.write_text("log: {}\nmanagement: { enabled: false }\n", encoding="utf-8")
|
||||
|
||||
channel = DummyControlChannel()
|
||||
app = ControlledApp(str(cfg), control_channel=channel)
|
||||
app = ControlledApp(str(cfg), control_channels=[channel])
|
||||
|
||||
runner = asyncio.create_task(app.start())
|
||||
await asyncio.sleep(0.12)
|
||||
@@ -47,11 +47,14 @@ def test_control_channel_can_stop_manager(tmp_path):
|
||||
|
||||
status_text = await channel.on_status()
|
||||
assert "state=running" in status_text
|
||||
assert "worker_inflight=" in status_text
|
||||
assert "worker_timed_out_inflight=" in status_text
|
||||
|
||||
stop_text = await channel.on_stop()
|
||||
assert "stop signal accepted" in stop_text
|
||||
|
||||
await runner
|
||||
# Менеджер при остановке не вызывает control_channel.stop() (канал остаётся доступным)
|
||||
await app.stop()
|
||||
assert channel.stopped is True
|
||||
|
||||
asyncio.run(scenario())
|
||||
|
||||
Reference in New Issue
Block a user