fix(open3dmodel): unwrap {success,data,error} envelope from /api/recipes
Open3DModel returns the same envelope for /api/recipes as for /api/pose; the bare-list code path stays as a fallback for older mocks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
33d66019ee
commit
cb940dc1cd
2 files changed
+30
-4
No files matched your search
@@ -59,6 +59,18 @@ def test_list_recipes_happy_path():
|
||||
assert headers.get("X-Api-Key") == "K"
|
||||
|
||||
|
||||
def test_list_recipes_envelope_shape():
|
||||
"""Open3DModel wraps /api/recipes in {success, data, error}."""
|
||||
body = {"success": True,
|
||||
"data": [{"id": "abc", "name": "P2", "symmetry_type": "cylindrical"}],
|
||||
"error": None}
|
||||
response = httpx.Response(200, json=body)
|
||||
client = Open3DModelClient("http://o3d:8878", api_key="K", timeout_s=2.0)
|
||||
with patch("httpx.Client.get", return_value=response):
|
||||
recs = client.list_recipes()
|
||||
assert recs == body["data"]
|
||||
|
||||
|
||||
def test_list_recipes_connect_error_raises_unavailable():
|
||||
client = Open3DModelClient("http://o3d:8878", api_key="K", timeout_s=2.0)
|
||||
with patch("httpx.Client.get", side_effect=httpx.ConnectError("nope")):
|
||||
|
||||
Reference in new issue
Block a user