Skip to content

Commit

Permalink
chore(test): change test name (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Sep 4, 2024
1 parent 7b4ca37 commit 7ccc82b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/api_resources/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,59 @@
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:
response = client.with_raw_response.ping()

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:
with client.with_streaming_response.ping() as response:
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:
response = await async_client.with_raw_response.ping()

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:
async with async_client.with_streaming_response.ping() as response:
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

0 comments on commit 7ccc82b

Please sign in to comment.