|
1 | 1 | from typing import Any |
2 | 2 | from unittest.mock import patch |
3 | 3 |
|
4 | | -import pytest |
5 | | -from fastapi import HTTPException |
6 | 4 | from fastapi.testclient import TestClient |
7 | 5 |
|
8 | | -from cas_reference_product.app import _raise_workflow_backend_failure, create_app |
| 6 | +from cas_reference_product.app import create_app |
9 | 7 | from cas_reference_product.config import Settings |
10 | 8 | from cas_reference_product.workflow import WorkflowAgentServiceError |
11 | 9 |
|
@@ -71,23 +69,3 @@ def test_workflow_api_sanitizes_external_service_failures(envelope: "Any") -> No |
71 | 69 | assert response.status_code == 502 |
72 | 70 | assert response.json() == {"detail": "Workflow backend request failed"} |
73 | 71 | assert "sensitive" not in response.text |
74 | | - |
75 | | - |
76 | | -def test_workflow_backend_failure_preserves_exception_chain() -> None: |
77 | | - with pytest.raises(HTTPException) as caught: |
78 | | - try: |
79 | | - raise RuntimeError("sensitive provider detail") |
80 | | - except RuntimeError as provider_error: |
81 | | - try: |
82 | | - raise WorkflowAgentServiceError("Foundry workflow invocation failed") from ( |
83 | | - provider_error |
84 | | - ) |
85 | | - except WorkflowAgentServiceError as workflow_error: |
86 | | - _raise_workflow_backend_failure(workflow_error) |
87 | | - |
88 | | - assert caught.value.status_code == 502 |
89 | | - assert caught.value.detail == "Workflow backend request failed" |
90 | | - assert isinstance(caught.value.__cause__, WorkflowAgentServiceError) |
91 | | - assert str(caught.value.__cause__) == "Foundry workflow invocation failed" |
92 | | - assert isinstance(caught.value.__cause__.__cause__, RuntimeError) |
93 | | - assert str(caught.value.__cause__.__cause__) == "sensitive provider detail" |
0 commit comments