MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / test_upstream_error

Function test_upstream_error

tests/api_utils/test_error_utils.py:163–173  ·  view source on GitHub ↗

Test scenario: Create 502 upstream error Verify: Status code and message format

()

Source from the content-addressed store, hash-verified

161
162
163def test_upstream_error():
164 """
165 Test scenario: Create 502 upstream error
166 Verify: Status code and message format
167 """
168 from api_utils.error_utils import upstream_error
169
170 result = upstream_error(req_id="req606", message="Playwright timeout")
171
172 assert result.status_code == 502
173 assert result.detail == "[req606] Playwright timeout"
174
175
176def test_service_unavailable_default_retry():

Callers

nothing calls this directly

Calls 1

upstream_errorFunction · 0.90

Tested by

no test coverage detected