Home / Class/ TestAsyncVersions Class — anthropic-sdk-python Architecture

TestAsyncVersions Class — anthropic-sdk-python Architecture

Architecture documentation for the TestAsyncVersions class in test_versions.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  cc5d9341_3efe_1819_2f5c_c9d739117e76["TestAsyncVersions"]
  f908ff67_bd4c_08a3_ee5a_ee64b11668d9["VersionCreateResponse"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|extends| f908ff67_bd4c_08a3_ee5a_ee64b11668d9
  afe7703a_af1f_24a7_4585_11d4db26afdb["VersionRetrieveResponse"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|extends| afe7703a_af1f_24a7_4585_11d4db26afdb
  368f5447_0419_5bd2_ea28_a955ca5ff532["VersionDeleteResponse"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|extends| 368f5447_0419_5bd2_ea28_a955ca5ff532
  f855b303_fe65_db92_5ad8_65ddc98de902["test_versions.py"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|defined in| f855b303_fe65_db92_5ad8_65ddc98de902
  713c7bc8_f6aa_9332_950f_51f833926a13["test_method_create()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| 713c7bc8_f6aa_9332_950f_51f833926a13
  7d679d7c_a879_4d45_db5a_b08f4d69f937["test_method_create_with_all_params()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| 7d679d7c_a879_4d45_db5a_b08f4d69f937
  785c8c5f_8bcd_9369_bc86_e1c69b4e4010["test_raw_response_create()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| 785c8c5f_8bcd_9369_bc86_e1c69b4e4010
  fb519daa_2142_01d7_2573_f5fc7a27ad87["test_streaming_response_create()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| fb519daa_2142_01d7_2573_f5fc7a27ad87
  0a382344_dbc2_e763_733b_9b472b14d6dd["test_path_params_create()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| 0a382344_dbc2_e763_733b_9b472b14d6dd
  9f172c6a_ad00_dd3a_56af_0bffdb508a28["test_method_retrieve()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| 9f172c6a_ad00_dd3a_56af_0bffdb508a28
  ea2ed35f_4361_305e_de67_c32c608084a3["test_method_retrieve_with_all_params()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| ea2ed35f_4361_305e_de67_c32c608084a3
  fbf9aa99_85f7_ce34_e4cb_bfea457d28b2["test_raw_response_retrieve()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| fbf9aa99_85f7_ce34_e4cb_bfea457d28b2
  12e37d4e_074a_dc0c_9cbe_6c3c143a4410["test_streaming_response_retrieve()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| 12e37d4e_074a_dc0c_9cbe_6c3c143a4410
  cc0f50c3_4f6d_6678_4c02_c8bc5ca7c039["test_path_params_retrieve()"]
  cc5d9341_3efe_1819_2f5c_c9d739117e76 -->|method| cc0f50c3_4f6d_6678_4c02_c8bc5ca7c039

Relationship Graph

Source Code

tests/api_resources/beta/skills/test_versions.py lines 241–458

class TestAsyncVersions:
    parametrize = pytest.mark.parametrize(
        "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
    )

    @pytest.mark.skip(reason="prism binary unsupported")
    @parametrize
    async def test_method_create(self, async_client: AsyncAnthropic) -> None:
        version = await async_client.beta.skills.versions.create(
            skill_id="skill_id",
        )
        assert_matches_type(VersionCreateResponse, version, path=["response"])

    @pytest.mark.skip(reason="prism binary unsupported")
    @parametrize
    async def test_method_create_with_all_params(self, async_client: AsyncAnthropic) -> None:
        version = await async_client.beta.skills.versions.create(
            skill_id="skill_id",
            files=[b"raw file contents"],
            betas=["string"],
        )
        assert_matches_type(VersionCreateResponse, version, path=["response"])

    @pytest.mark.skip(reason="prism binary unsupported")
    @parametrize
    async def test_raw_response_create(self, async_client: AsyncAnthropic) -> None:
        response = await async_client.beta.skills.versions.with_raw_response.create(
            skill_id="skill_id",
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        version = response.parse()
        assert_matches_type(VersionCreateResponse, version, path=["response"])

    @pytest.mark.skip(reason="prism binary unsupported")
    @parametrize
    async def test_streaming_response_create(self, async_client: AsyncAnthropic) -> None:
        async with async_client.beta.skills.versions.with_streaming_response.create(
            skill_id="skill_id",
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            version = await response.parse()
            assert_matches_type(VersionCreateResponse, version, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip(reason="prism binary unsupported")
    @parametrize
    async def test_path_params_create(self, async_client: AsyncAnthropic) -> None:
        with pytest.raises(ValueError, match=r"Expected a non-empty value for `skill_id` but received ''"):
            await async_client.beta.skills.versions.with_raw_response.create(
                skill_id="",
            )

    @parametrize
    async def test_method_retrieve(self, async_client: AsyncAnthropic) -> None:
        version = await async_client.beta.skills.versions.retrieve(
            version="version",
            skill_id="skill_id",
        )
        assert_matches_type(VersionRetrieveResponse, version, path=["response"])

    @parametrize
    async def test_method_retrieve_with_all_params(self, async_client: AsyncAnthropic) -> None:
        version = await async_client.beta.skills.versions.retrieve(
            version="version",
            skill_id="skill_id",
            betas=["string"],
        )
        assert_matches_type(VersionRetrieveResponse, version, path=["response"])

    @parametrize
    async def test_raw_response_retrieve(self, async_client: AsyncAnthropic) -> None:
        response = await async_client.beta.skills.versions.with_raw_response.retrieve(
            version="version",
            skill_id="skill_id",
        )

Frequently Asked Questions

What is the TestAsyncVersions class?
TestAsyncVersions is a class in the anthropic-sdk-python codebase, defined in tests/api_resources/beta/skills/test_versions.py.
Where is TestAsyncVersions defined?
TestAsyncVersions is defined in tests/api_resources/beta/skills/test_versions.py at line 241.
What does TestAsyncVersions extend?
TestAsyncVersions extends VersionCreateResponse, VersionRetrieveResponse, VersionDeleteResponse.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free