Skip to content

Commit 90021f2

Browse files
chore(internal): update client tests (#965)
1 parent a2e3a70 commit 90021f2

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

tests/test_client.py

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from increase import Increase, AsyncIncrease, APIResponseValidationError
2525
from increase._types import Omit
26+
from increase._utils import maybe_transform
2627
from increase._models import BaseModel, FinalRequestOptions
2728
from increase._constants import RAW_RESPONSE_HEADER
2829
from increase._exceptions import IncreaseError, APIStatusError, APITimeoutError, APIResponseValidationError
@@ -32,6 +33,7 @@
3233
BaseClient,
3334
make_request_options,
3435
)
36+
from increase.types.account_create_params import AccountCreateParams
3537

3638
from .utils import update_env
3739

@@ -760,10 +762,13 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
760762
"/accounts",
761763
body=cast(
762764
object,
763-
dict(
764-
name="New Account!",
765-
entity_id="entity_n8y8tnk2p9339ti393yi",
766-
program_id="program_i2v2os4mwza1oetokh9i",
765+
maybe_transform(
766+
dict(
767+
name="New Account!",
768+
entity_id="entity_n8y8tnk2p9339ti393yi",
769+
program_id="program_i2v2os4mwza1oetokh9i",
770+
),
771+
AccountCreateParams,
767772
),
768773
),
769774
cast_to=httpx.Response,
@@ -782,10 +787,13 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
782787
"/accounts",
783788
body=cast(
784789
object,
785-
dict(
786-
name="New Account!",
787-
entity_id="entity_n8y8tnk2p9339ti393yi",
788-
program_id="program_i2v2os4mwza1oetokh9i",
790+
maybe_transform(
791+
dict(
792+
name="New Account!",
793+
entity_id="entity_n8y8tnk2p9339ti393yi",
794+
program_id="program_i2v2os4mwza1oetokh9i",
795+
),
796+
AccountCreateParams,
789797
),
790798
),
791799
cast_to=httpx.Response,
@@ -1595,10 +1603,13 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
15951603
"/accounts",
15961604
body=cast(
15971605
object,
1598-
dict(
1599-
name="New Account!",
1600-
entity_id="entity_n8y8tnk2p9339ti393yi",
1601-
program_id="program_i2v2os4mwza1oetokh9i",
1606+
maybe_transform(
1607+
dict(
1608+
name="New Account!",
1609+
entity_id="entity_n8y8tnk2p9339ti393yi",
1610+
program_id="program_i2v2os4mwza1oetokh9i",
1611+
),
1612+
AccountCreateParams,
16021613
),
16031614
),
16041615
cast_to=httpx.Response,
@@ -1617,10 +1628,13 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
16171628
"/accounts",
16181629
body=cast(
16191630
object,
1620-
dict(
1621-
name="New Account!",
1622-
entity_id="entity_n8y8tnk2p9339ti393yi",
1623-
program_id="program_i2v2os4mwza1oetokh9i",
1631+
maybe_transform(
1632+
dict(
1633+
name="New Account!",
1634+
entity_id="entity_n8y8tnk2p9339ti393yi",
1635+
program_id="program_i2v2os4mwza1oetokh9i",
1636+
),
1637+
AccountCreateParams,
16241638
),
16251639
),
16261640
cast_to=httpx.Response,

0 commit comments

Comments
 (0)