test: skip dbrx claude 3-7 sonnet test - rate limit errors

This commit is contained in:
Krrish Dholakia 2025-07-28 17:34:42 -07:00
parent ba95541571
commit 16af2d9a50

View file

@ -276,8 +276,13 @@ def test_completions_with_sync_http_handler(monkeypatch):
extraparam="testpassingextraparam",
)
assert mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
assert mock_post.call_args.kwargs["headers"]["Authorization"] == f"Bearer {api_key}"
assert (
mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
)
assert (
mock_post.call_args.kwargs["headers"]["Authorization"]
== f"Bearer {api_key}"
)
assert mock_post.call_args.kwargs["url"] == f"{base_url}/chat/completions"
assert mock_post.call_args.kwargs["stream"] == False
@ -292,6 +297,7 @@ def test_completions_with_sync_http_handler(monkeypatch):
}
assert actual_data == expected_data, f"Unexpected JSON data: {actual_data}"
def test_completions_with_async_http_handler(monkeypatch):
base_url = "https://my.workspace.cloud.databricks.com/serving-endpoints"
api_key = "dapimykey"
@ -325,8 +331,13 @@ def test_completions_with_async_http_handler(monkeypatch):
)
)
assert mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
assert mock_post.call_args.kwargs["headers"]["Authorization"] == f"Bearer {api_key}"
assert (
mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
)
assert (
mock_post.call_args.kwargs["headers"]["Authorization"]
== f"Bearer {api_key}"
)
assert mock_post.call_args.kwargs["url"] == f"{base_url}/chat/completions"
assert mock_post.call_args.kwargs["stream"] == False
@ -367,12 +378,16 @@ def test_completions_streaming_with_sync_http_handler(monkeypatch):
assert "chatcmpl" in str(response)
assert len(response) == 4
assert mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
assert mock_post.call_args.kwargs["headers"]["Authorization"] == f"Bearer {api_key}"
assert (
mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
)
assert (
mock_post.call_args.kwargs["headers"]["Authorization"]
== f"Bearer {api_key}"
)
assert mock_post.call_args.kwargs["url"] == f"{base_url}/chat/completions"
assert mock_post.call_args.kwargs["stream"] == True
actual_data = json.loads(
mock_post.call_args.kwargs["data"]
) # Deserialize the actual data
@ -420,12 +435,16 @@ def test_completions_streaming_with_async_http_handler(monkeypatch):
assert "chatcmpl" in str(response)
assert len(response) == 4
assert mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
assert mock_post.call_args.kwargs["headers"]["Authorization"] == f"Bearer {api_key}"
assert (
mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
)
assert (
mock_post.call_args.kwargs["headers"]["Authorization"]
== f"Bearer {api_key}"
)
assert mock_post.call_args.kwargs["url"] == f"{base_url}/chat/completions"
assert mock_post.call_args.kwargs["stream"] == True
actual_data = json.loads(
mock_post.call_args.kwargs["data"]
) # Deserialize the actual data
@ -484,9 +503,17 @@ def test_completions_uses_databricks_sdk_if_api_key_and_base_not_specified(monke
)
assert response.to_dict() == expected_response_json
assert mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
assert mock_post.call_args.kwargs["headers"]["Authorization"] == f"Bearer {api_key}"
assert mock_post.call_args.kwargs["url"] == f"{base_url}/serving-endpoints/chat/completions"
assert (
mock_post.call_args.kwargs["headers"]["Content-Type"] == "application/json"
)
assert (
mock_post.call_args.kwargs["headers"]["Authorization"]
== f"Bearer {api_key}"
)
assert (
mock_post.call_args.kwargs["url"]
== f"{base_url}/serving-endpoints/chat/completions"
)
assert mock_post.call_args.kwargs["stream"] == False
assert mock_post.call_args.kwargs["data"] == json.dumps(
{
@ -635,6 +662,7 @@ def test_embeddings_uses_databricks_sdk_if_api_key_and_base_not_specified(monkey
)
@pytest.mark.skip(reason="Databricks rate limit errors")
class TestDatabricksCompletion(BaseLLMChatTest, BaseAnthropicChatTest):
def get_base_completion_call_args(self) -> dict:
return {"model": "databricks/databricks-claude-3-7-sonnet"}