test: the on-demand routes' other callers ack over the socket, not the mailbox

test_api_v3_bool_coercion, test_api_v3_lazy_plugin_discovery and
test_web_api's stop test checked the mailbox write; they now get an ack
from a mocked control socket. The stop route touches no manager any more,
so it leaves the removed-catch-all sample. A request that was sent is
never 'not listening' (pins the sent check the mutation run let through).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-10-05 09:40:31 -04:00
co-authored by Claude Opus 5.5
parent c461f4efdb
commit fd0a4b50f9
5 changed files with 36 additions and 14 deletions
+11 -8
View File
@@ -528,14 +528,17 @@ class TestDisplayAPI:
from web_interface.blueprints.api_v3 import api_v3
mock_cache_manager = api_v3.cache_manager = MagicMock()
response = client.post('/api/v3/display/on-demand/stop')
# May return 200 if successful or 500 on error
assert response.status_code in [200, 500]
# Verify stop request was set in cache if successful
if response.status_code == 200:
assert mock_cache_manager.set.called
with patch('web_interface.blueprints.api_v3.display.control_client.on_demand_stop',
side_effect=lambda request_id, **kw: {'accepted': True}) as stop:
response = client.post('/api/v3/display/on-demand/stop')
assert response.status_code == 200
assert response.get_json()['data']['transport'] == 'socket'
stop.assert_called_once()
# The request goes over the control socket; nothing is written to
# the cache (the file mailbox is gone).
mock_cache_manager.set.assert_not_called()
class TestPluginsAPI: