Skip to content

Commit

Permalink
chore(internal): update client tests (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Feb 12, 2025
1 parent 9bc534d commit 8c5600a
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from metronome import Metronome, AsyncMetronome, APIResponseValidationError
from metronome._types import Omit
from metronome._utils import parse_datetime, maybe_transform
from metronome._models import BaseModel, FinalRequestOptions
from metronome._constants import RAW_RESPONSE_HEADER
from metronome._exceptions import APIStatusError, MetronomeError, APITimeoutError, APIResponseValidationError
Expand All @@ -32,6 +33,7 @@
BaseClient,
make_request_options,
)
from metronome.types.contract_create_params import ContractCreateParams

from .utils import update_env

Expand Down Expand Up @@ -747,9 +749,12 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
"/contracts/create",
body=cast(
object,
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at="2020-01-01T00:00:00.000Z",
maybe_transform(
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at=parse_datetime("2020-01-01T00:00:00.000Z"),
),
ContractCreateParams,
),
),
cast_to=httpx.Response,
Expand All @@ -768,9 +773,12 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
"/contracts/create",
body=cast(
object,
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at="2020-01-01T00:00:00.000Z",
maybe_transform(
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at=parse_datetime("2020-01-01T00:00:00.000Z"),
),
ContractCreateParams,
),
),
cast_to=httpx.Response,
Expand Down Expand Up @@ -1563,9 +1571,12 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
"/contracts/create",
body=cast(
object,
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at="2020-01-01T00:00:00.000Z",
maybe_transform(
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at=parse_datetime("2020-01-01T00:00:00.000Z"),
),
ContractCreateParams,
),
),
cast_to=httpx.Response,
Expand All @@ -1584,9 +1595,12 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
"/contracts/create",
body=cast(
object,
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at="2020-01-01T00:00:00.000Z",
maybe_transform(
dict(
customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
starting_at=parse_datetime("2020-01-01T00:00:00.000Z"),
),
ContractCreateParams,
),
),
cast_to=httpx.Response,
Expand Down

0 comments on commit 8c5600a

Please sign in to comment.