mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
test: expect anthropic-workspace-id header in Mantle tests
This commit is contained in:
parent
01e6693aa7
commit
7e2cb9449c
1 changed files with 6 additions and 6 deletions
|
|
@ -215,7 +215,7 @@ def test_mantle_validate_environment_sets_workspace_header():
|
|||
optional_params={},
|
||||
litellm_params={"aws_bedrock_project_id": "proj_abc123def456"},
|
||||
)
|
||||
assert headers["anthropic-workspace"] == "proj_abc123def456"
|
||||
assert headers["anthropic-workspace-id"] == "proj_abc123def456"
|
||||
|
||||
|
||||
def test_mantle_validate_environment_without_project_id():
|
||||
|
|
@ -227,7 +227,7 @@ def test_mantle_validate_environment_without_project_id():
|
|||
optional_params={},
|
||||
litellm_params={"aws_bedrock_project_id": None},
|
||||
)
|
||||
assert "anthropic-workspace" not in headers
|
||||
assert "anthropic-workspace-id" not in headers
|
||||
|
||||
|
||||
def test_mantle_messages_validate_environment_sets_workspace_header():
|
||||
|
|
@ -240,7 +240,7 @@ def test_mantle_messages_validate_environment_sets_workspace_header():
|
|||
litellm_params={"aws_bedrock_project_id": "proj_abc123def456"},
|
||||
api_base="https://bedrock-mantle.us-east-1.api.aws/anthropic/v1/messages",
|
||||
)
|
||||
assert headers["anthropic-workspace"] == "proj_abc123def456"
|
||||
assert headers["anthropic-workspace-id"] == "proj_abc123def456"
|
||||
assert api_base == "https://bedrock-mantle.us-east-1.api.aws/anthropic/v1/messages"
|
||||
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ def test_mantle_messages_validate_environment_without_project_id():
|
|||
optional_params={},
|
||||
litellm_params={},
|
||||
)
|
||||
assert "anthropic-workspace" not in headers
|
||||
assert "anthropic-workspace-id" not in headers
|
||||
|
||||
|
||||
def test_mantle_completion_sends_workspace_header_and_clean_body():
|
||||
|
|
@ -279,7 +279,7 @@ def test_mantle_completion_sends_workspace_header_and_clean_body():
|
|||
assert response.choices[0].message.content == "ok"
|
||||
assert len(requests) == 1
|
||||
assert requests[0]["path"] == "/anthropic/v1/messages"
|
||||
assert requests[0]["headers"]["anthropic-workspace"] == "proj_abc123def456"
|
||||
assert requests[0]["headers"]["anthropic-workspace-id"] == "proj_abc123def456"
|
||||
assert "aws_bedrock_project_id" not in requests[0]["body"]
|
||||
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ async def test_mantle_anthropic_messages_sends_workspace_header_and_clean_body()
|
|||
assert response["content"][0]["text"] == "ok"
|
||||
assert len(requests) == 1
|
||||
assert requests[0]["path"] == "/anthropic/v1/messages"
|
||||
assert requests[0]["headers"]["anthropic-workspace"] == "proj_abc123def456"
|
||||
assert requests[0]["headers"]["anthropic-workspace-id"] == "proj_abc123def456"
|
||||
assert "aws_bedrock_project_id" not in requests[0]["body"]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue