Skip to content

Commit

Permalink
chore(tests): limit array example length (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Nov 18, 2024
1 parent 0f1e208 commit a9d4125
Show file tree
Hide file tree
Showing 21 changed files with 481 additions and 4,713 deletions.
112 changes: 8 additions & 104 deletions tests/api_resources/internal_accounts/test_balance_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,7 @@ def test_method_create(self, client: ModernTreasury) -> None:
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
)
assert_matches_type(BalanceReport, balance_report, path=["response"])
Expand All @@ -64,19 +52,7 @@ def test_raw_response_create(self, client: ModernTreasury) -> None:
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
)

Expand All @@ -98,19 +74,7 @@ def test_streaming_response_create(self, client: ModernTreasury) -> None:
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
) as response:
assert not response.is_closed
Expand All @@ -135,19 +99,7 @@ def test_path_params_create(self, client: ModernTreasury) -> None:
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
)

Expand Down Expand Up @@ -313,19 +265,7 @@ async def test_method_create(self, async_client: AsyncModernTreasury) -> None:
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
)
assert_matches_type(BalanceReport, balance_report, path=["response"])
Expand All @@ -343,19 +283,7 @@ async def test_raw_response_create(self, async_client: AsyncModernTreasury) -> N
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
)

Expand All @@ -377,19 +305,7 @@ async def test_streaming_response_create(self, async_client: AsyncModernTreasury
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
) as response:
assert not response.is_closed
Expand All @@ -414,19 +330,7 @@ async def test_path_params_create(self, async_client: AsyncModernTreasury) -> No
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
{
"amount": 0,
"balance_type": "closing_available",
"vendor_code": "vendor_code",
"vendor_code_type": "vendor_code_type",
},
}
],
)

Expand Down
64 changes: 2 additions & 62 deletions tests/api_resources/payment_orders/test_reversals.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None:
"pending_balance_amount": {"foo": 0},
"posted_balance_amount": {"foo": 0},
"show_resulting_ledger_account_balances": True,
},
{
"amount": 0,
"direction": "credit",
"ledger_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"available_balance_amount": {"foo": 0},
"lock_version": 0,
"metadata": {
"key": "value",
"foo": "bar",
"modern": "treasury",
},
"pending_balance_amount": {"foo": 0},
"posted_balance_amount": {"foo": 0},
"show_resulting_ledger_account_balances": True,
},
{
"amount": 0,
"direction": "credit",
"ledger_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"available_balance_amount": {"foo": 0},
"lock_version": 0,
"metadata": {
"key": "value",
"foo": "bar",
"modern": "treasury",
},
"pending_balance_amount": {"foo": 0},
"posted_balance_amount": {"foo": 0},
"show_resulting_ledger_account_balances": True,
},
}
],
"description": "description",
"effective_at": parse_datetime("2019-12-27T18:11:19.117Z"),
Expand Down Expand Up @@ -263,37 +233,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea
"pending_balance_amount": {"foo": 0},
"posted_balance_amount": {"foo": 0},
"show_resulting_ledger_account_balances": True,
},
{
"amount": 0,
"direction": "credit",
"ledger_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"available_balance_amount": {"foo": 0},
"lock_version": 0,
"metadata": {
"key": "value",
"foo": "bar",
"modern": "treasury",
},
"pending_balance_amount": {"foo": 0},
"posted_balance_amount": {"foo": 0},
"show_resulting_ledger_account_balances": True,
},
{
"amount": 0,
"direction": "credit",
"ledger_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"available_balance_amount": {"foo": 0},
"lock_version": 0,
"metadata": {
"key": "value",
"foo": "bar",
"modern": "treasury",
},
"pending_balance_amount": {"foo": 0},
"posted_balance_amount": {"foo": 0},
"show_resulting_ledger_account_balances": True,
},
}
],
"description": "description",
"effective_at": parse_datetime("2019-12-27T18:11:19.117Z"),
Expand Down
20 changes: 10 additions & 10 deletions tests/api_resources/test_account_collection_flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ class TestAccountCollectionFlows:
def test_method_create(self, client: ModernTreasury) -> None:
account_collection_flow = client.account_collection_flows.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
payment_types=["string"],
)
assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"])

@parametrize
def test_method_create_with_all_params(self, client: ModernTreasury) -> None:
account_collection_flow = client.account_collection_flows.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
receiving_countries=["USA", "AUS", "BEL"],
payment_types=["string"],
receiving_countries=["USA"],
)
assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"])

@parametrize
def test_raw_response_create(self, client: ModernTreasury) -> None:
response = client.account_collection_flows.with_raw_response.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
payment_types=["string"],
)

assert response.is_closed is True
Expand All @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: ModernTreasury) -> None:
def test_streaming_response_create(self, client: ModernTreasury) -> None:
with client.account_collection_flows.with_streaming_response.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
payment_types=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down Expand Up @@ -188,24 +188,24 @@ class TestAsyncAccountCollectionFlows:
async def test_method_create(self, async_client: AsyncModernTreasury) -> None:
account_collection_flow = await async_client.account_collection_flows.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
payment_types=["string"],
)
assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"])

@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncModernTreasury) -> None:
account_collection_flow = await async_client.account_collection_flows.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
receiving_countries=["USA", "AUS", "BEL"],
payment_types=["string"],
receiving_countries=["USA"],
)
assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"])

@parametrize
async def test_raw_response_create(self, async_client: AsyncModernTreasury) -> None:
response = await async_client.account_collection_flows.with_raw_response.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
payment_types=["string"],
)

assert response.is_closed is True
Expand All @@ -217,7 +217,7 @@ async def test_raw_response_create(self, async_client: AsyncModernTreasury) -> N
async def test_streaming_response_create(self, async_client: AsyncModernTreasury) -> None:
async with async_client.account_collection_flows.with_streaming_response.create(
counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
payment_types=["string", "string", "string"],
payment_types=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down
Loading

0 comments on commit a9d4125

Please sign in to comment.