test_models.py — anthropic-sdk-python Source File
Architecture documentation for test_models.py, a python file in the anthropic-sdk-python codebase. 8 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR cb00baf8_f406_80c3_d958_9edd1a3e6a98["test_models.py"] bb0af148_44a9_df40_49c4_0fa6ceb5a403["os"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> bb0af148_44a9_df40_49c4_0fa6ceb5a403 89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875["typing"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> 89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875 cde8421b_93c7_41e4_d69d_2a3f1bade2f2["pytest"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> cde8421b_93c7_41e4_d69d_2a3f1bade2f2 d10c5377_2939_0f0b_cc44_8759393f2853["anthropic"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> d10c5377_2939_0f0b_cc44_8759393f2853 cf46c35e_ae7e_a652_f32b_5dd703f4d658["utils.py"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> cf46c35e_ae7e_a652_f32b_5dd703f4d658 08e9c9e7_d7f9_615f_5837_b3de69122e37["assert_matches_type"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> 08e9c9e7_d7f9_615f_5837_b3de69122e37 7bee6b18_3397_1147_6683_6b09ec705805["anthropic.pagination"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> 7bee6b18_3397_1147_6683_6b09ec705805 02abf1f6_b512_32df_c4f5_940df96192d8["anthropic.types.beta"] cb00baf8_f406_80c3_d958_9edd1a3e6a98 --> 02abf1f6_b512_32df_c4f5_940df96192d8 style cb00baf8_f406_80c3_d958_9edd1a3e6a98 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
import os
from typing import Any, cast
import pytest
from anthropic import Anthropic, AsyncAnthropic
from tests.utils import assert_matches_type
from anthropic.pagination import SyncPage, AsyncPage
from anthropic.types.beta import BetaModelInfo
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
class TestModels:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@parametrize
def test_method_retrieve(self, client: Anthropic) -> None:
model = client.beta.models.retrieve(
model_id="model_id",
)
assert_matches_type(BetaModelInfo, model, path=["response"])
@parametrize
def test_method_retrieve_with_all_params(self, client: Anthropic) -> None:
model = client.beta.models.retrieve(
model_id="model_id",
betas=["string"],
)
assert_matches_type(BetaModelInfo, model, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Anthropic) -> None:
response = client.beta.models.with_raw_response.retrieve(
model_id="model_id",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
model = response.parse()
assert_matches_type(BetaModelInfo, model, path=["response"])
@parametrize
def test_streaming_response_retrieve(self, client: Anthropic) -> None:
with client.beta.models.with_streaming_response.retrieve(
model_id="model_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
model = response.parse()
assert_matches_type(BetaModelInfo, model, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
// ... (128 more lines)
Domain
Subdomains
Classes
Dependencies
- anthropic
- anthropic.pagination
- anthropic.types.beta
- assert_matches_type
- os
- pytest
- typing
- utils.py
Source
Frequently Asked Questions
What does test_models.py do?
test_models.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain, Authentication subdomain.
What does test_models.py depend on?
test_models.py imports 8 module(s): anthropic, anthropic.pagination, anthropic.types.beta, assert_matches_type, os, pytest, typing, utils.py.
Where is test_models.py in the architecture?
test_models.py is located at tests/api_resources/beta/test_models.py (domain: AnthropicClient, subdomain: Authentication, directory: tests/api_resources/beta).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free