Files
GenericAgent/frontends/tests/test_bridge_capabilities.py
T
YI QI LIMandabraxas914 efb3bc6ad1 feat(desktop): compiled React Desktop 2.0 v0.2.1 renderer update (#787)
* fix(desktop): expose explicit backup capabilities

* fix(desktop): align titlebar controls with native metrics

* release(desktop): prepare portable v0.2.1

* build(desktop): rebuild compiled dist from source 4a67226

Rebuild the compiled-only React Desktop 2.0 renderer from abraxas914/GenericAgent
main @4a67226, carrying the v0.2.1 iterations that PR #784 was closed to await:
live turn-timer persistence across session switch, Mixin image-to-path fallback,
folder drag-drop, per-turn duration, and image-thumbnail repair.

- dist/**: regenerated 98 manifest assets + entry HTML
- build-provenance.json: sourceCommit -> 4a67226, manifest sha256 recomputed
- verify-compiled-dist.mjs: expectedSourceCommit -> 4a67226
- dist/README.md: provenance source commit updated
- desktop_bridge.py, test_bridge_origin_security.py: synced to 4a67226
- core (agentmain.py, llmcore*, src/**, public/**) remains zero-diff vs upstream

---------

Co-authored-by: abraxas914 <abraxas345589144233@outlook.com>
2026-08-30 14:21:51 +08:00

41 lines
1.3 KiB
Python

"""Regression coverage for explicit Desktop bridge capabilities."""
from __future__ import annotations
import asyncio
import pytest
from aiohttp.test_utils import TestClient, TestServer
from frontends.tests.test_bridge_sessions import _mod as bridge
def test_real_aiohttp_routes_expose_data_backup_capability(
monkeypatch: pytest.MonkeyPatch,
) -> None:
monkeypatch.setattr(bridge.services, "autostart_extras", lambda: None)
monkeypatch.setattr(bridge.services, "stop_all_extras", lambda: None)
async def scenario() -> None:
app = bridge.create_app()
client = TestClient(TestServer(app))
await client.start_server()
try:
inspect_head = await client.head("/memory/import/inspect")
assert inspect_head.status == 404
capabilities = await client.get("/services/capabilities")
assert capabilities.status == 200
assert await capabilities.json() == {"dataBackup": True}
routes = {
(route.method, route.resource.canonical)
for route in app.router.routes()
}
assert ("POST", "/memory/import/inspect") in routes
assert ("POST", "/memory/import") in routes
assert ("POST", "/memory/export") in routes
finally:
await client.close()
asyncio.run(scenario())