style(host-agent): format Console task submission files
This commit is contained in:
@@ -49,9 +49,7 @@ def _build_client(
|
||||
session_manager = SessionManager(ttl_seconds=3600.0)
|
||||
metadata_store: TaskMetadataStore | None = None
|
||||
if include_metadata_store:
|
||||
metadata_store = TaskMetadataStore(
|
||||
db_path=tmp_path / "task_metadata.sqlite3"
|
||||
)
|
||||
metadata_store = TaskMetadataStore(db_path=tmp_path / "task_metadata.sqlite3")
|
||||
|
||||
app = create_console_app(
|
||||
config=config,
|
||||
@@ -373,7 +371,11 @@ def _make_submission_recorder(
|
||||
def asyncio_run(coro):
|
||||
import asyncio
|
||||
|
||||
return asyncio.get_event_loop().run_until_complete(coro) if asyncio.get_event_loop().is_running() else asyncio.run(coro)
|
||||
return (
|
||||
asyncio.get_event_loop().run_until_complete(coro)
|
||||
if asyncio.get_event_loop().is_running()
|
||||
else asyncio.run(coro)
|
||||
)
|
||||
|
||||
|
||||
def test_tasks_page_renders_submission_form_with_device_options(tmp_path) -> None:
|
||||
@@ -444,8 +446,7 @@ def test_authenticated_explicit_device_submission_uses_runtime_id(tmp_path) -> N
|
||||
|
||||
assert response.status_code == 303
|
||||
assert (
|
||||
response.headers["location"]
|
||||
== "/tasks?submitted=1&task_id=task-cloud-explicit"
|
||||
response.headers["location"] == "/tasks?submitted=1&task_id=task-cloud-explicit"
|
||||
)
|
||||
assert captured == {"goal": "open mail", "device_id": "device-cloud-a"}
|
||||
|
||||
@@ -577,9 +578,7 @@ def test_cloud_definitive_rejection_renders_safe_error_without_calling_history(
|
||||
tmp_path,
|
||||
) -> None:
|
||||
submit, captured = _make_submission_recorder(
|
||||
raise_api_error=HostAgentAPIError(
|
||||
403, "Host self-submission is disabled"
|
||||
),
|
||||
raise_api_error=HostAgentAPIError(403, "Host self-submission is disabled"),
|
||||
)
|
||||
client, context = _build_client(tmp_path, submit_self_task=submit)
|
||||
context["manager"].register_device(
|
||||
|
||||
Reference in New Issue
Block a user