mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
test(mcp): stop comprehension variable shadowing the body helper
The inlined comprehension bound a loop variable named body, which made body a function local on CPython 3.12.2 and raised UnboundLocalError at the later call to the module-level body() helper; rename it to bad Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
3f2214a095
commit
de73489dd1
1 changed files with 1 additions and 1 deletions
|
|
@ -197,7 +197,7 @@ def test_malformed_bodies_missing_users_and_foreign_servers_are_rejected(gateway
|
|||
path: Final = f"/v1/mcp/server/{identity}/user-env-vars"
|
||||
payload: Final[dict[str, JsonValue]] = {"values": {TOKEN: "x"}}
|
||||
malformed: Final[tuple[dict[str, JsonValue], ...]] = ({"values": {TOKEN: 7}}, {"values": ["a"]}, {})
|
||||
assert [gateway.request("POST", path, body, key=key).status_code for body in malformed] == [422, 422, 422]
|
||||
assert [gateway.request("POST", path, bad, key=key).status_code for bad in malformed] == [422, 422, 422]
|
||||
assert set_names(env_status(gateway, key, identity)) == {TOKEN: False}
|
||||
assert [gateway.client.request(method, path, json=payload).status_code for method in METHODS] == [401, 401, 401]
|
||||
no_user: Final = tuple(gateway.request(method, path, payload, key=userless) for method in METHODS)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue