diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py index bd9d9078..0849d753 100644 --- a/tests/api_resources/test_client.py +++ b/tests/api_resources/test_client.py @@ -14,13 +14,13 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestTopLevel: +class TestClient: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_ping(self, client: ModernTreasury) -> None: - top_level = client.ping() - assert_matches_type(PingResponse, top_level, path=["response"]) + client_ = client.ping() + assert_matches_type(PingResponse, client_, path=["response"]) @parametrize def test_raw_response_ping(self, client: ModernTreasury) -> None: @@ -28,8 +28,8 @@ def test_raw_response_ping(self, client: ModernTreasury) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top_level = response.parse() - assert_matches_type(PingResponse, top_level, path=["response"]) + client_ = response.parse() + assert_matches_type(PingResponse, client_, path=["response"]) @parametrize def test_streaming_response_ping(self, client: ModernTreasury) -> None: @@ -37,19 +37,19 @@ def test_streaming_response_ping(self, client: ModernTreasury) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top_level = response.parse() - assert_matches_type(PingResponse, top_level, path=["response"]) + client_ = response.parse() + assert_matches_type(PingResponse, client_, path=["response"]) assert cast(Any, response.is_closed) is True -class TestAsyncTopLevel: +class TestAsyncClient: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_ping(self, async_client: AsyncModernTreasury) -> None: - top_level = await async_client.ping() - assert_matches_type(PingResponse, top_level, path=["response"]) + client = await async_client.ping() + assert_matches_type(PingResponse, client, path=["response"]) @parametrize async def test_raw_response_ping(self, async_client: AsyncModernTreasury) -> None: @@ -57,8 +57,8 @@ async def test_raw_response_ping(self, async_client: AsyncModernTreasury) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top_level = response.parse() - assert_matches_type(PingResponse, top_level, path=["response"]) + client = response.parse() + assert_matches_type(PingResponse, client, path=["response"]) @parametrize async def test_streaming_response_ping(self, async_client: AsyncModernTreasury) -> None: @@ -66,7 +66,7 @@ async def test_streaming_response_ping(self, async_client: AsyncModernTreasury) assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top_level = await response.parse() - assert_matches_type(PingResponse, top_level, path=["response"]) + client = await response.parse() + assert_matches_type(PingResponse, client, path=["response"]) assert cast(Any, response.is_closed) is True