diff --git a/.github/workflows/handle-release-pr-title-edit.yml b/.github/workflows/handle-release-pr-title-edit.yml index 38cb73f8b..8d69bd2d3 100644 --- a/.github/workflows/handle-release-pr-title-edit.yml +++ b/.github/workflows/handle-release-pr-title-edit.yml @@ -9,8 +9,9 @@ jobs: update_pr_content: name: Update pull request content if: | - (github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) || - (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version') && + ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) || + (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) && + startsWith(github.event.pull_request.head.ref, 'release-please--') && github.event.pull_request.state == 'open' && github.event.sender.login != 'stainless-bot' && github.repository == 'increase/increase-python' diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 37341f5bf..c215c4860 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.13.4" + ".": "0.13.5" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ca16f56bc..775d4392f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.13.5 (2023-10-03) + +Full Changelog: [v0.13.4...v0.13.5](https://github.com/increase/increase-python/compare/v0.13.4...v0.13.5) + +### Features + +* **api:** expand event categories and Entity status options ([#144](https://github.com/increase/increase-python/issues/144)) ([5b452f0](https://github.com/increase/increase-python/commit/5b452f0f06d390f1440260314d39568e8d27456d)) +* **client:** handle retry-after header with a date format ([#142](https://github.com/increase/increase-python/issues/142)) ([0363f9b](https://github.com/increase/increase-python/commit/0363f9b8d38ff94088ce0d67ff63657118dade58)) + + +### Chores + +* **tests:** update test examples ([#145](https://github.com/increase/increase-python/issues/145)) ([9cbe137](https://github.com/increase/increase-python/commit/9cbe13777b7f6271520452e51ec200f78bd01077)) + ## 0.13.4 (2023-09-29) Full Changelog: [v0.13.3...v0.13.4](https://github.com/Increase/increase-python/compare/v0.13.3...v0.13.4) diff --git a/bin/check-test-server b/bin/check-test-server index 34efa9dac..a6fa34950 100755 --- a/bin/check-test-server +++ b/bin/check-test-server @@ -10,13 +10,13 @@ function prism_is_running() { } function is_overriding_api_base_url() { - [ -n "$API_BASE_URL" ] + [ -n "$TEST_API_BASE_URL" ] } if is_overriding_api_base_url ; then # If someone is running the tests against the live API, we can trust they know # what they're doing and exit early. - echo -e "${GREEN}✔ Running tests against ${API_BASE_URL}${NC}" + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" exit 0 elif prism_is_running ; then diff --git a/pyproject.toml b/pyproject.toml index 65666b5c7..e86e547cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "increase" -version = "0.13.4" +version = "0.13.5" description = "Client library for the increase API" readme = "README.md" authors = ["Increase "] diff --git a/src/increase/_base_client.py b/src/increase/_base_client.py index fc6f1b6c7..e84baa1e1 100644 --- a/src/increase/_base_client.py +++ b/src/increase/_base_client.py @@ -3,8 +3,10 @@ import json import time import uuid +import email import inspect import platform +import email.utils from types import TracebackType from random import random from typing import ( @@ -616,10 +618,22 @@ def _calculate_retry_timeout( try: # About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After # - # TODO: we may want to handle the case where the header is using the http-date syntax: "Retry-After: # ". See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#syntax for # details. - retry_after = -1 if response_headers is None else int(response_headers.get("retry-after")) + if response_headers is not None: + retry_header = response_headers.get("retry-after") + try: + retry_after = int(retry_header) + except Exception: + retry_date_tuple = email.utils.parsedate_tz(retry_header) + if retry_date_tuple is None: + retry_after = -1 + else: + retry_date = email.utils.mktime_tz(retry_date_tuple) + retry_after = int(retry_date - time.time()) + else: + retry_after = -1 + except Exception: retry_after = -1 diff --git a/src/increase/_version.py b/src/increase/_version.py index 4dd5486ab..d8790fe52 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. __title__ = "increase" -__version__ = "0.13.4" # x-release-please-version +__version__ = "0.13.5" # x-release-please-version diff --git a/src/increase/resources/entities/entities.py b/src/increase/resources/entities/entities.py index fd171edd2..d73e219cf 100644 --- a/src/increase/resources/entities/entities.py +++ b/src/increase/resources/entities/entities.py @@ -163,6 +163,7 @@ def list( created_at: entity_list_params.CreatedAt | NotGiven = NOT_GIVEN, cursor: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + status: entity_list_params.Status | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -200,6 +201,7 @@ def list( "created_at": created_at, "cursor": cursor, "limit": limit, + "status": status, }, entity_list_params.EntityListParams, ), @@ -432,6 +434,7 @@ def list( created_at: entity_list_params.CreatedAt | NotGiven = NOT_GIVEN, cursor: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + status: entity_list_params.Status | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -469,6 +472,7 @@ def list( "created_at": created_at, "cursor": cursor, "limit": limit, + "status": status, }, entity_list_params.EntityListParams, ), diff --git a/src/increase/resources/event_subscriptions.py b/src/increase/resources/event_subscriptions.py index 2109e2bd0..5c46173c1 100644 --- a/src/increase/resources/event_subscriptions.py +++ b/src/increase/resources/event_subscriptions.py @@ -36,6 +36,8 @@ def create( "ach_prenotification.updated", "ach_transfer.created", "ach_transfer.updated", + "bookkeeping_account.created", + "bookkeeping_entry_set.updated", "card.created", "card.updated", "card_payment.created", @@ -54,9 +56,12 @@ def create( "document.created", "entity.created", "entity.updated", + "event_subscription.created", + "event_subscription.updated", "export.created", "export.updated", "external_account.created", + "external_account.updated", "file.created", "group.updated", "group.heartbeat", @@ -120,6 +125,10 @@ def create( updated. - `ach_transfer.created` - Occurs whenever an ACH Transfer is created. - `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated. + - `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is + created. + - `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is + created. - `card.created` - Occurs whenever a Card is created. - `card.updated` - Occurs whenever a Card is updated. - `card_payment.created` - Occurs whenever a Card Payment is created. @@ -141,9 +150,14 @@ def create( - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `event_subscription.created` - Occurs whenever an Event Subscription is + created. + - `event_subscription.updated` - Occurs whenever an Event Subscription is + updated. - `export.created` - Occurs whenever an Export is created. - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. + - `external_account.updated` - Occurs whenever an External Account is updated. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. - `group.heartbeat` - Increase may send webhooks with this category to see if a @@ -379,6 +393,8 @@ async def create( "ach_prenotification.updated", "ach_transfer.created", "ach_transfer.updated", + "bookkeeping_account.created", + "bookkeeping_entry_set.updated", "card.created", "card.updated", "card_payment.created", @@ -397,9 +413,12 @@ async def create( "document.created", "entity.created", "entity.updated", + "event_subscription.created", + "event_subscription.updated", "export.created", "export.updated", "external_account.created", + "external_account.updated", "file.created", "group.updated", "group.heartbeat", @@ -463,6 +482,10 @@ async def create( updated. - `ach_transfer.created` - Occurs whenever an ACH Transfer is created. - `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated. + - `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is + created. + - `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is + created. - `card.created` - Occurs whenever a Card is created. - `card.updated` - Occurs whenever a Card is updated. - `card_payment.created` - Occurs whenever a Card Payment is created. @@ -484,9 +507,14 @@ async def create( - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `event_subscription.created` - Occurs whenever an Event Subscription is + created. + - `event_subscription.updated` - Occurs whenever an Event Subscription is + updated. - `export.created` - Occurs whenever an Export is created. - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. + - `external_account.updated` - Occurs whenever an External Account is updated. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. - `group.heartbeat` - Increase may send webhooks with this category to see if a diff --git a/src/increase/types/entity.py b/src/increase/types/entity.py index 749a1ce21..24610bf59 100644 --- a/src/increase/types/entity.py +++ b/src/increase/types/entity.py @@ -492,13 +492,14 @@ class Entity(BaseModel): Will be present if `structure` is equal to `natural_person`. """ - relationship: Optional[Literal["affiliated", "informational", "unaffiliated"]] - """The relationship between your group and the entity. - - - `affiliated` - The entity is controlled by your group. - - `informational` - The entity is for informational purposes only. - - `unaffiliated` - The entity is not controlled by your group, but can still - directly open accounts. + status: Literal["active", "archived", "disabled"] + """The status of the entity. + + - `active` - The entity is active. + - `archived` - The entity is archived, and can no longer be used to create + accounts. + - `disabled` - The entity is temporarily disabled and cannot be used for + financial activity. """ structure: Literal["corporation", "natural_person", "joint", "trust"] diff --git a/src/increase/types/entity_list_params.py b/src/increase/types/entity_list_params.py index 07f02b2e5..ecb972686 100644 --- a/src/increase/types/entity_list_params.py +++ b/src/increase/types/entity_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["EntityListParams", "CreatedAt"] +__all__ = ["EntityListParams", "CreatedAt", "Status"] class EntityListParams(TypedDict, total=False): @@ -23,6 +23,8 @@ class EntityListParams(TypedDict, total=False): The default (and maximum) is 100 objects. """ + status: Status + class CreatedAt(TypedDict, total=False): after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] @@ -48,3 +50,16 @@ class CreatedAt(TypedDict, total=False): Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. """ + + +_StatusReservedKeywords = TypedDict( + "_StatusReservedKeywords", + { + "in": List[Literal["active", "archived", "disabled"]], + }, + total=False, +) + + +class Status(_StatusReservedKeywords, total=False): + pass diff --git a/src/increase/types/event.py b/src/increase/types/event.py index 3ba4f5a65..297629345 100644 --- a/src/increase/types/event.py +++ b/src/increase/types/event.py @@ -30,6 +30,8 @@ class Event(BaseModel): "ach_prenotification.updated", "ach_transfer.created", "ach_transfer.updated", + "bookkeeping_account.created", + "bookkeeping_entry_set.updated", "card.created", "card.updated", "card_payment.created", @@ -48,9 +50,12 @@ class Event(BaseModel): "document.created", "entity.created", "entity.updated", + "event_subscription.created", + "event_subscription.updated", "export.created", "export.updated", "external_account.created", + "external_account.updated", "file.created", "group.updated", "group.heartbeat", @@ -100,6 +105,10 @@ class Event(BaseModel): updated. - `ach_transfer.created` - Occurs whenever an ACH Transfer is created. - `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated. + - `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is + created. + - `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is + created. - `card.created` - Occurs whenever a Card is created. - `card.updated` - Occurs whenever a Card is updated. - `card_payment.created` - Occurs whenever a Card Payment is created. @@ -121,9 +130,14 @@ class Event(BaseModel): - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `event_subscription.created` - Occurs whenever an Event Subscription is + created. + - `event_subscription.updated` - Occurs whenever an Event Subscription is + updated. - `export.created` - Occurs whenever an Export is created. - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. + - `external_account.updated` - Occurs whenever an External Account is updated. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. - `group.heartbeat` - Increase may send webhooks with this category to see if a diff --git a/src/increase/types/event_list_params.py b/src/increase/types/event_list_params.py index 00f7433b7..a58b39b96 100644 --- a/src/increase/types/event_list_params.py +++ b/src/increase/types/event_list_params.py @@ -45,6 +45,8 @@ class EventListParams(TypedDict, total=False): "ach_prenotification.updated", "ach_transfer.created", "ach_transfer.updated", + "bookkeeping_account.created", + "bookkeeping_entry_set.updated", "card.created", "card.updated", "card_payment.created", @@ -63,9 +65,12 @@ class EventListParams(TypedDict, total=False): "document.created", "entity.created", "entity.updated", + "event_subscription.created", + "event_subscription.updated", "export.created", "export.updated", "external_account.created", + "external_account.updated", "file.created", "group.updated", "group.heartbeat", diff --git a/src/increase/types/event_subscription.py b/src/increase/types/event_subscription.py index bf1b40f09..b35851486 100644 --- a/src/increase/types/event_subscription.py +++ b/src/increase/types/event_subscription.py @@ -29,6 +29,8 @@ class EventSubscription(BaseModel): "ach_prenotification.updated", "ach_transfer.created", "ach_transfer.updated", + "bookkeeping_account.created", + "bookkeeping_entry_set.updated", "card.created", "card.updated", "card_payment.created", @@ -47,9 +49,12 @@ class EventSubscription(BaseModel): "document.created", "entity.created", "entity.updated", + "event_subscription.created", + "event_subscription.updated", "export.created", "export.updated", "external_account.created", + "external_account.updated", "file.created", "group.updated", "group.heartbeat", @@ -99,6 +104,10 @@ class EventSubscription(BaseModel): updated. - `ach_transfer.created` - Occurs whenever an ACH Transfer is created. - `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated. + - `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is + created. + - `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is + created. - `card.created` - Occurs whenever a Card is created. - `card.updated` - Occurs whenever a Card is updated. - `card_payment.created` - Occurs whenever a Card Payment is created. @@ -120,9 +129,14 @@ class EventSubscription(BaseModel): - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `event_subscription.created` - Occurs whenever an Event Subscription is + created. + - `event_subscription.updated` - Occurs whenever an Event Subscription is + updated. - `export.created` - Occurs whenever an Export is created. - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. + - `external_account.updated` - Occurs whenever an External Account is updated. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. - `group.heartbeat` - Increase may send webhooks with this category to see if a diff --git a/src/increase/types/event_subscription_create_params.py b/src/increase/types/event_subscription_create_params.py index a35431c8d..e2ad76f4a 100644 --- a/src/increase/types/event_subscription_create_params.py +++ b/src/increase/types/event_subscription_create_params.py @@ -23,6 +23,8 @@ class EventSubscriptionCreateParams(TypedDict, total=False): "ach_prenotification.updated", "ach_transfer.created", "ach_transfer.updated", + "bookkeeping_account.created", + "bookkeeping_entry_set.updated", "card.created", "card.updated", "card_payment.created", @@ -41,9 +43,12 @@ class EventSubscriptionCreateParams(TypedDict, total=False): "document.created", "entity.created", "entity.updated", + "event_subscription.created", + "event_subscription.updated", "export.created", "export.updated", "external_account.created", + "external_account.updated", "file.created", "group.updated", "group.heartbeat", @@ -92,6 +97,10 @@ class EventSubscriptionCreateParams(TypedDict, total=False): updated. - `ach_transfer.created` - Occurs whenever an ACH Transfer is created. - `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated. + - `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is + created. + - `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is + created. - `card.created` - Occurs whenever a Card is created. - `card.updated` - Occurs whenever a Card is updated. - `card_payment.created` - Occurs whenever a Card Payment is created. @@ -113,9 +122,14 @@ class EventSubscriptionCreateParams(TypedDict, total=False): - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `event_subscription.created` - Occurs whenever an Event Subscription is + created. + - `event_subscription.updated` - Occurs whenever an Event Subscription is + updated. - `export.created` - Occurs whenever an Export is created. - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. + - `external_account.updated` - Occurs whenever an External Account is updated. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. - `group.heartbeat` - Increase may send webhooks with this category to see if a diff --git a/tests/api_resources/entities/test_beneficial_owners.py b/tests/api_resources/entities/test_beneficial_owners.py index f3fa4cb3e..bfbdf5186 100644 --- a/tests/api_resources/entities/test_beneficial_owners.py +++ b/tests/api_resources/entities/test_beneficial_owners.py @@ -11,7 +11,7 @@ from increase.types import Entity from increase._utils import parse_date -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -25,22 +25,22 @@ def test_method_create(self, client: Increase) -> None: beneficial_owner = client.entities.beneficial_owners.create( beneficial_owner={ "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), + "name": "Ian Crease", + "date_of_birth": parse_date("1970-01-31"), "address": { - "line1": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "zip": "10045", }, "identification": { "method": "social_security_number", - "number": "xxxx", + "number": "078051120", }, }, - "prongs": ["ownership", "control"], + "prongs": ["control"], }, - entity_id="string", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @@ -49,19 +49,19 @@ def test_method_create_with_all_params(self, client: Increase) -> None: beneficial_owner = client.entities.beneficial_owners.create( beneficial_owner={ "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), + "name": "Ian Crease", + "date_of_birth": parse_date("1970-01-31"), "address": { - "line1": "x", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "city": "New York", + "state": "NY", + "zip": "10045", }, "confirmed_no_us_tax_id": True, "identification": { "method": "social_security_number", - "number": "xxxx", + "number": "078051120", "passport": { "file_id": "string", "expiration_date": parse_date("2019-12-27"), @@ -82,18 +82,18 @@ def test_method_create_with_all_params(self, client: Increase) -> None: }, }, }, - "company_title": "x", - "prongs": ["ownership", "control"], + "company_title": "CEO", + "prongs": ["control"], }, - entity_id="string", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @parametrize def test_method_archive(self, client: Increase) -> None: beneficial_owner = client.entities.beneficial_owners.archive( - beneficial_owner_id="string", - entity_id="string", + beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @@ -101,13 +101,13 @@ def test_method_archive(self, client: Increase) -> None: def test_method_update_address(self, client: Increase) -> None: beneficial_owner = client.entities.beneficial_owners.update_address( address={ - "line1": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "zip": "10045", }, - beneficial_owner_id="string", - entity_id="string", + beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @@ -115,14 +115,14 @@ def test_method_update_address(self, client: Increase) -> None: def test_method_update_address_with_all_params(self, client: Increase) -> None: beneficial_owner = client.entities.beneficial_owners.update_address( address={ - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "line2": "Unit 2", + "city": "New York", + "state": "NY", + "zip": "10045", }, - beneficial_owner_id="string", - entity_id="string", + beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @@ -137,22 +137,22 @@ async def test_method_create(self, client: AsyncIncrease) -> None: beneficial_owner = await client.entities.beneficial_owners.create( beneficial_owner={ "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), + "name": "Ian Crease", + "date_of_birth": parse_date("1970-01-31"), "address": { - "line1": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "zip": "10045", }, "identification": { "method": "social_security_number", - "number": "xxxx", + "number": "078051120", }, }, - "prongs": ["ownership", "control"], + "prongs": ["control"], }, - entity_id="string", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @@ -161,19 +161,19 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non beneficial_owner = await client.entities.beneficial_owners.create( beneficial_owner={ "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), + "name": "Ian Crease", + "date_of_birth": parse_date("1970-01-31"), "address": { - "line1": "x", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "city": "New York", + "state": "NY", + "zip": "10045", }, "confirmed_no_us_tax_id": True, "identification": { "method": "social_security_number", - "number": "xxxx", + "number": "078051120", "passport": { "file_id": "string", "expiration_date": parse_date("2019-12-27"), @@ -194,18 +194,18 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non }, }, }, - "company_title": "x", - "prongs": ["ownership", "control"], + "company_title": "CEO", + "prongs": ["control"], }, - entity_id="string", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @parametrize async def test_method_archive(self, client: AsyncIncrease) -> None: beneficial_owner = await client.entities.beneficial_owners.archive( - beneficial_owner_id="string", - entity_id="string", + beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @@ -213,13 +213,13 @@ async def test_method_archive(self, client: AsyncIncrease) -> None: async def test_method_update_address(self, client: AsyncIncrease) -> None: beneficial_owner = await client.entities.beneficial_owners.update_address( address={ - "line1": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "zip": "10045", }, - beneficial_owner_id="string", - entity_id="string", + beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) @@ -227,13 +227,13 @@ async def test_method_update_address(self, client: AsyncIncrease) -> None: async def test_method_update_address_with_all_params(self, client: AsyncIncrease) -> None: beneficial_owner = await client.entities.beneficial_owners.update_address( address={ - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "line2": "Unit 2", + "city": "New York", + "state": "NY", + "zip": "10045", }, - beneficial_owner_id="string", - entity_id="string", + beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7", + entity_id="entity_n8y8tnk2p9339ti393yi", ) assert_matches_type(Entity, beneficial_owner, path=["response"]) diff --git a/tests/api_resources/entities/test_supplemental_documents.py b/tests/api_resources/entities/test_supplemental_documents.py index 08b95da2c..11746b64e 100644 --- a/tests/api_resources/entities/test_supplemental_documents.py +++ b/tests/api_resources/entities/test_supplemental_documents.py @@ -12,7 +12,7 @@ from increase.pagination import SyncPage, AsyncPage from increase.types.entities import SupplementalDocument -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -25,7 +25,7 @@ class TestSupplementalDocuments: def test_method_create(self, client: Increase) -> None: supplemental_document = client.entities.supplemental_documents.create( "string", - file_id="string", + file_id="file_makxrc67oh9l6sg7w9yc", ) assert_matches_type(Entity, supplemental_document, path=["response"]) @@ -55,7 +55,7 @@ class TestAsyncSupplementalDocuments: async def test_method_create(self, client: AsyncIncrease) -> None: supplemental_document = await client.entities.supplemental_documents.create( "string", - file_id="string", + file_id="file_makxrc67oh9l6sg7w9yc", ) assert_matches_type(Entity, supplemental_document, path=["response"]) diff --git a/tests/api_resources/simulations/test_account_statements.py b/tests/api_resources/simulations/test_account_statements.py index 54e629878..3c9b17744 100644 --- a/tests/api_resources/simulations/test_account_statements.py +++ b/tests/api_resources/simulations/test_account_statements.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import AccountStatement -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -22,7 +22,7 @@ class TestAccountStatements: @parametrize def test_method_create(self, client: Increase) -> None: account_statement = client.simulations.account_statements.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(AccountStatement, account_statement, path=["response"]) @@ -35,6 +35,6 @@ class TestAsyncAccountStatements: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: account_statement = await client.simulations.account_statements.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(AccountStatement, account_statement, path=["response"]) diff --git a/tests/api_resources/simulations/test_account_transfers.py b/tests/api_resources/simulations/test_account_transfers.py index c1f304ed4..020f376a7 100644 --- a/tests/api_resources/simulations/test_account_transfers.py +++ b/tests/api_resources/simulations/test_account_transfers.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import AccountTransfer -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/simulations/test_ach_transfers.py b/tests/api_resources/simulations/test_ach_transfers.py index c8e64c13f..2605ce095 100644 --- a/tests/api_resources/simulations/test_ach_transfers.py +++ b/tests/api_resources/simulations/test_ach_transfers.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.types.simulations import ACHTransferSimulation -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,16 +24,16 @@ class TestACHTransfers: @parametrize def test_method_create_inbound(self, client: Increase) -> None: ach_transfer = client.simulations.ach_transfers.create_inbound( - account_number_id="string", - amount=0, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, ) assert_matches_type(ACHTransferSimulation, ach_transfer, path=["response"]) @parametrize def test_method_create_inbound_with_all_params(self, client: Increase) -> None: ach_transfer = client.simulations.ach_transfers.create_inbound( - account_number_id="string", - amount=0, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, company_descriptive_date="x", company_discretionary_data="x", company_entry_description="x", @@ -77,16 +77,16 @@ class TestAsyncACHTransfers: @parametrize async def test_method_create_inbound(self, client: AsyncIncrease) -> None: ach_transfer = await client.simulations.ach_transfers.create_inbound( - account_number_id="string", - amount=0, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, ) assert_matches_type(ACHTransferSimulation, ach_transfer, path=["response"]) @parametrize async def test_method_create_inbound_with_all_params(self, client: AsyncIncrease) -> None: ach_transfer = await client.simulations.ach_transfers.create_inbound( - account_number_id="string", - amount=0, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, company_descriptive_date="x", company_discretionary_data="x", company_entry_description="x", diff --git a/tests/api_resources/simulations/test_card_disputes.py b/tests/api_resources/simulations/test_card_disputes.py index 764ccaafb..146445045 100644 --- a/tests/api_resources/simulations/test_card_disputes.py +++ b/tests/api_resources/simulations/test_card_disputes.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import CardDispute -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,7 +23,7 @@ class TestCardDisputes: def test_method_action(self, client: Increase) -> None: card_dispute = client.simulations.card_disputes.action( "string", - status="accepted", + status="rejected", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -31,8 +31,8 @@ def test_method_action(self, client: Increase) -> None: def test_method_action_with_all_params(self, client: Increase) -> None: card_dispute = client.simulations.card_disputes.action( "string", - status="accepted", - explanation="x", + status="rejected", + explanation="This was a valid recurring transaction", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -46,7 +46,7 @@ class TestAsyncCardDisputes: async def test_method_action(self, client: AsyncIncrease) -> None: card_dispute = await client.simulations.card_disputes.action( "string", - status="accepted", + status="rejected", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -54,7 +54,7 @@ async def test_method_action(self, client: AsyncIncrease) -> None: async def test_method_action_with_all_params(self, client: AsyncIncrease) -> None: card_dispute = await client.simulations.card_disputes.action( "string", - status="accepted", - explanation="x", + status="rejected", + explanation="This was a valid recurring transaction", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) diff --git a/tests/api_resources/simulations/test_card_profiles.py b/tests/api_resources/simulations/test_card_profiles.py index d76a4ef77..c76158d4b 100644 --- a/tests/api_resources/simulations/test_card_profiles.py +++ b/tests/api_resources/simulations/test_card_profiles.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import CardProfile -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/simulations/test_card_refunds.py b/tests/api_resources/simulations/test_card_refunds.py index 49d0112f6..bfb00caea 100644 --- a/tests/api_resources/simulations/test_card_refunds.py +++ b/tests/api_resources/simulations/test_card_refunds.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import Transaction -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -22,7 +22,7 @@ class TestCardRefunds: @parametrize def test_method_create(self, client: Increase) -> None: card_refund = client.simulations.card_refunds.create( - transaction_id="string", + transaction_id="transaction_uyrp7fld2ium70oa7oi", ) assert_matches_type(Transaction, card_refund, path=["response"]) @@ -35,6 +35,6 @@ class TestAsyncCardRefunds: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: card_refund = await client.simulations.card_refunds.create( - transaction_id="string", + transaction_id="transaction_uyrp7fld2ium70oa7oi", ) assert_matches_type(Transaction, card_refund, path=["response"]) diff --git a/tests/api_resources/simulations/test_cards.py b/tests/api_resources/simulations/test_cards.py index b7d52f30f..6580e8fa1 100644 --- a/tests/api_resources/simulations/test_cards.py +++ b/tests/api_resources/simulations/test_cards.py @@ -11,7 +11,7 @@ from increase.types import Transaction from increase.types.simulations import CardAuthorizationSimulation -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,17 +23,17 @@ class TestCards: @parametrize def test_method_authorize(self, client: Increase) -> None: card = client.simulations.cards.authorize( - amount=1, + amount=1000, ) assert_matches_type(CardAuthorizationSimulation, card, path=["response"]) @parametrize def test_method_authorize_with_all_params(self, client: Increase) -> None: card = client.simulations.cards.authorize( - amount=1, - card_id="string", + amount=1000, + card_id="card_oubs0hwk5rn6knuecxg2", digital_wallet_token_id="string", - event_subscription_id="string", + event_subscription_id="event_subscription_001dzz0r20rcdxgb013zqb8m04g", physical_card_id="string", ) assert_matches_type(CardAuthorizationSimulation, card, path=["response"]) @@ -41,16 +41,16 @@ def test_method_authorize_with_all_params(self, client: Increase) -> None: @parametrize def test_method_settlement(self, client: Increase) -> None: card = client.simulations.cards.settlement( - card_id="string", - pending_transaction_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", + pending_transaction_id="pending_transaction_k1sfetcau2qbvjbzgju4", ) assert_matches_type(Transaction, card, path=["response"]) @parametrize def test_method_settlement_with_all_params(self, client: Increase) -> None: card = client.simulations.cards.settlement( - card_id="string", - pending_transaction_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", + pending_transaction_id="pending_transaction_k1sfetcau2qbvjbzgju4", amount=1, ) assert_matches_type(Transaction, card, path=["response"]) @@ -64,17 +64,17 @@ class TestAsyncCards: @parametrize async def test_method_authorize(self, client: AsyncIncrease) -> None: card = await client.simulations.cards.authorize( - amount=1, + amount=1000, ) assert_matches_type(CardAuthorizationSimulation, card, path=["response"]) @parametrize async def test_method_authorize_with_all_params(self, client: AsyncIncrease) -> None: card = await client.simulations.cards.authorize( - amount=1, - card_id="string", + amount=1000, + card_id="card_oubs0hwk5rn6knuecxg2", digital_wallet_token_id="string", - event_subscription_id="string", + event_subscription_id="event_subscription_001dzz0r20rcdxgb013zqb8m04g", physical_card_id="string", ) assert_matches_type(CardAuthorizationSimulation, card, path=["response"]) @@ -82,16 +82,16 @@ async def test_method_authorize_with_all_params(self, client: AsyncIncrease) -> @parametrize async def test_method_settlement(self, client: AsyncIncrease) -> None: card = await client.simulations.cards.settlement( - card_id="string", - pending_transaction_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", + pending_transaction_id="pending_transaction_k1sfetcau2qbvjbzgju4", ) assert_matches_type(Transaction, card, path=["response"]) @parametrize async def test_method_settlement_with_all_params(self, client: AsyncIncrease) -> None: card = await client.simulations.cards.settlement( - card_id="string", - pending_transaction_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", + pending_transaction_id="pending_transaction_k1sfetcau2qbvjbzgju4", amount=1, ) assert_matches_type(Transaction, card, path=["response"]) diff --git a/tests/api_resources/simulations/test_check_deposits.py b/tests/api_resources/simulations/test_check_deposits.py index 7c284fa2e..208e60471 100644 --- a/tests/api_resources/simulations/test_check_deposits.py +++ b/tests/api_resources/simulations/test_check_deposits.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import CheckDeposit -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/simulations/test_check_transfers.py b/tests/api_resources/simulations/test_check_transfers.py index b27aba2ad..dfc16038d 100644 --- a/tests/api_resources/simulations/test_check_transfers.py +++ b/tests/api_resources/simulations/test_check_transfers.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import CheckTransfer -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/simulations/test_digital_wallet_token_requests.py b/tests/api_resources/simulations/test_digital_wallet_token_requests.py index 54330235e..2f613fed2 100644 --- a/tests/api_resources/simulations/test_digital_wallet_token_requests.py +++ b/tests/api_resources/simulations/test_digital_wallet_token_requests.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types.simulations import DigitalWalletTokenRequestCreateResponse -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -22,7 +22,7 @@ class TestDigitalWalletTokenRequests: @parametrize def test_method_create(self, client: Increase) -> None: digital_wallet_token_request = client.simulations.digital_wallet_token_requests.create( - card_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", ) assert_matches_type(DigitalWalletTokenRequestCreateResponse, digital_wallet_token_request, path=["response"]) @@ -35,6 +35,6 @@ class TestAsyncDigitalWalletTokenRequests: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: digital_wallet_token_request = await client.simulations.digital_wallet_token_requests.create( - card_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", ) assert_matches_type(DigitalWalletTokenRequestCreateResponse, digital_wallet_token_request, path=["response"]) diff --git a/tests/api_resources/simulations/test_documents.py b/tests/api_resources/simulations/test_documents.py index a0ef675cb..b67c0b9e9 100644 --- a/tests/api_resources/simulations/test_documents.py +++ b/tests/api_resources/simulations/test_documents.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import Document -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -22,7 +22,7 @@ class TestDocuments: @parametrize def test_method_create(self, client: Increase) -> None: document = client.simulations.documents.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(Document, document, path=["response"]) @@ -35,6 +35,6 @@ class TestAsyncDocuments: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: document = await client.simulations.documents.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(Document, document, path=["response"]) diff --git a/tests/api_resources/simulations/test_inbound_funds_holds.py b/tests/api_resources/simulations/test_inbound_funds_holds.py index 03c262c8d..23fcd8569 100644 --- a/tests/api_resources/simulations/test_inbound_funds_holds.py +++ b/tests/api_resources/simulations/test_inbound_funds_holds.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types.simulations import InboundFundsHoldReleaseResponse -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/simulations/test_inbound_wire_drawdown_requests.py b/tests/api_resources/simulations/test_inbound_wire_drawdown_requests.py index a39087bfe..8cfbd1f99 100644 --- a/tests/api_resources/simulations/test_inbound_wire_drawdown_requests.py +++ b/tests/api_resources/simulations/test_inbound_wire_drawdown_requests.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import InboundWireDrawdownRequest -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -22,36 +22,36 @@ class TestInboundWireDrawdownRequests: @parametrize def test_method_create(self, client: Increase) -> None: inbound_wire_drawdown_request = client.simulations.inbound_wire_drawdown_requests.create( - amount=0, - beneficiary_account_number="x", - beneficiary_routing_number="x", - currency="x", - message_to_recipient="x", - originator_account_number="x", - originator_routing_number="x", - recipient_account_number_id="string", + amount=10000, + beneficiary_account_number="987654321", + beneficiary_routing_number="101050001", + currency="USD", + message_to_recipient="Invoice 29582", + originator_account_number="987654321", + originator_routing_number="101050001", + recipient_account_number_id="account_number_v18nkfqm6afpsrvy82b2", ) assert_matches_type(InboundWireDrawdownRequest, inbound_wire_drawdown_request, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: inbound_wire_drawdown_request = client.simulations.inbound_wire_drawdown_requests.create( - amount=0, - beneficiary_account_number="x", - beneficiary_routing_number="x", - currency="x", - message_to_recipient="x", - originator_account_number="x", - originator_routing_number="x", - recipient_account_number_id="string", - beneficiary_address_line1="x", - beneficiary_address_line2="x", + amount=10000, + beneficiary_account_number="987654321", + beneficiary_routing_number="101050001", + currency="USD", + message_to_recipient="Invoice 29582", + originator_account_number="987654321", + originator_routing_number="101050001", + recipient_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + beneficiary_address_line1="33 Liberty Street", + beneficiary_address_line2="New York, NY, 10045", beneficiary_address_line3="x", - beneficiary_name="x", - originator_address_line1="x", - originator_address_line2="x", + beneficiary_name="Ian Crease", + originator_address_line1="33 Liberty Street", + originator_address_line2="New York, NY, 10045", originator_address_line3="x", - originator_name="x", + originator_name="Ian Crease", originator_to_beneficiary_information_line1="x", originator_to_beneficiary_information_line2="x", originator_to_beneficiary_information_line3="x", @@ -68,36 +68,36 @@ class TestAsyncInboundWireDrawdownRequests: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: inbound_wire_drawdown_request = await client.simulations.inbound_wire_drawdown_requests.create( - amount=0, - beneficiary_account_number="x", - beneficiary_routing_number="x", - currency="x", - message_to_recipient="x", - originator_account_number="x", - originator_routing_number="x", - recipient_account_number_id="string", + amount=10000, + beneficiary_account_number="987654321", + beneficiary_routing_number="101050001", + currency="USD", + message_to_recipient="Invoice 29582", + originator_account_number="987654321", + originator_routing_number="101050001", + recipient_account_number_id="account_number_v18nkfqm6afpsrvy82b2", ) assert_matches_type(InboundWireDrawdownRequest, inbound_wire_drawdown_request, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: inbound_wire_drawdown_request = await client.simulations.inbound_wire_drawdown_requests.create( - amount=0, - beneficiary_account_number="x", - beneficiary_routing_number="x", - currency="x", - message_to_recipient="x", - originator_account_number="x", - originator_routing_number="x", - recipient_account_number_id="string", - beneficiary_address_line1="x", - beneficiary_address_line2="x", + amount=10000, + beneficiary_account_number="987654321", + beneficiary_routing_number="101050001", + currency="USD", + message_to_recipient="Invoice 29582", + originator_account_number="987654321", + originator_routing_number="101050001", + recipient_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + beneficiary_address_line1="33 Liberty Street", + beneficiary_address_line2="New York, NY, 10045", beneficiary_address_line3="x", - beneficiary_name="x", - originator_address_line1="x", - originator_address_line2="x", + beneficiary_name="Ian Crease", + originator_address_line1="33 Liberty Street", + originator_address_line2="New York, NY, 10045", originator_address_line3="x", - originator_name="x", + originator_name="Ian Crease", originator_to_beneficiary_information_line1="x", originator_to_beneficiary_information_line2="x", originator_to_beneficiary_information_line3="x", diff --git a/tests/api_resources/simulations/test_interest_payments.py b/tests/api_resources/simulations/test_interest_payments.py index 8f912878d..05c141b90 100644 --- a/tests/api_resources/simulations/test_interest_payments.py +++ b/tests/api_resources/simulations/test_interest_payments.py @@ -11,7 +11,7 @@ from increase._utils import parse_datetime from increase.types.simulations import InterestPaymentSimulationResult -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,16 +23,16 @@ class TestInterestPayments: @parametrize def test_method_create(self, client: Increase) -> None: interest_payment = client.simulations.interest_payments.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, ) assert_matches_type(InterestPaymentSimulationResult, interest_payment, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: interest_payment = client.simulations.interest_payments.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, period_end=parse_datetime("2019-12-27T18:11:19.117Z"), period_start=parse_datetime("2019-12-27T18:11:19.117Z"), ) @@ -47,16 +47,16 @@ class TestAsyncInterestPayments: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: interest_payment = await client.simulations.interest_payments.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, ) assert_matches_type(InterestPaymentSimulationResult, interest_payment, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: interest_payment = await client.simulations.interest_payments.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, period_end=parse_datetime("2019-12-27T18:11:19.117Z"), period_start=parse_datetime("2019-12-27T18:11:19.117Z"), ) diff --git a/tests/api_resources/simulations/test_physical_cards.py b/tests/api_resources/simulations/test_physical_cards.py index 2c1de7c58..1505aa89e 100644 --- a/tests/api_resources/simulations/test_physical_cards.py +++ b/tests/api_resources/simulations/test_physical_cards.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import PhysicalCard -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,7 +23,7 @@ class TestPhysicalCards: def test_method_shipment_advance(self, client: Increase) -> None: physical_card = client.simulations.physical_cards.shipment_advance( "string", - shipment_status="pending", + shipment_status="shipped", ) assert_matches_type(PhysicalCard, physical_card, path=["response"]) @@ -37,6 +37,6 @@ class TestAsyncPhysicalCards: async def test_method_shipment_advance(self, client: AsyncIncrease) -> None: physical_card = await client.simulations.physical_cards.shipment_advance( "string", - shipment_status="pending", + shipment_status="shipped", ) assert_matches_type(PhysicalCard, physical_card, path=["response"]) diff --git a/tests/api_resources/simulations/test_programs.py b/tests/api_resources/simulations/test_programs.py index 38fea4d1c..3f12cfacb 100644 --- a/tests/api_resources/simulations/test_programs.py +++ b/tests/api_resources/simulations/test_programs.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import Program -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -22,7 +22,7 @@ class TestPrograms: @parametrize def test_method_create(self, client: Increase) -> None: program = client.simulations.programs.create( - name="x", + name="For Benefit Of", ) assert_matches_type(Program, program, path=["response"]) @@ -35,6 +35,6 @@ class TestAsyncPrograms: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: program = await client.simulations.programs.create( - name="x", + name="For Benefit Of", ) assert_matches_type(Program, program, path=["response"]) diff --git a/tests/api_resources/simulations/test_real_time_payments_transfers.py b/tests/api_resources/simulations/test_real_time_payments_transfers.py index 084c39548..5379ecc4d 100644 --- a/tests/api_resources/simulations/test_real_time_payments_transfers.py +++ b/tests/api_resources/simulations/test_real_time_payments_transfers.py @@ -11,7 +11,7 @@ from increase.types import RealTimePaymentsTransfer from increase.types.simulations import InboundRealTimePaymentsTransferSimulationResult -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -38,8 +38,8 @@ def test_method_complete_with_all_params(self, client: Increase) -> None: @parametrize def test_method_create_inbound(self, client: Increase) -> None: real_time_payments_transfer = client.simulations.real_time_payments_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, ) assert_matches_type( InboundRealTimePaymentsTransferSimulationResult, real_time_payments_transfer, path=["response"] @@ -48,13 +48,13 @@ def test_method_create_inbound(self, client: Increase) -> None: @parametrize def test_method_create_inbound_with_all_params(self, client: Increase) -> None: real_time_payments_transfer = client.simulations.real_time_payments_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, debtor_account_number="x", debtor_name="x", debtor_routing_number="xxxxxxxxx", remittance_information="x", - request_for_payment_id="string", + request_for_payment_id="real_time_payments_request_for_payment_28kcliz1oevcnqyn9qp7", ) assert_matches_type( InboundRealTimePaymentsTransferSimulationResult, real_time_payments_transfer, path=["response"] @@ -84,8 +84,8 @@ async def test_method_complete_with_all_params(self, client: AsyncIncrease) -> N @parametrize async def test_method_create_inbound(self, client: AsyncIncrease) -> None: real_time_payments_transfer = await client.simulations.real_time_payments_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, ) assert_matches_type( InboundRealTimePaymentsTransferSimulationResult, real_time_payments_transfer, path=["response"] @@ -94,13 +94,13 @@ async def test_method_create_inbound(self, client: AsyncIncrease) -> None: @parametrize async def test_method_create_inbound_with_all_params(self, client: AsyncIncrease) -> None: real_time_payments_transfer = await client.simulations.real_time_payments_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, debtor_account_number="x", debtor_name="x", debtor_routing_number="xxxxxxxxx", remittance_information="x", - request_for_payment_id="string", + request_for_payment_id="real_time_payments_request_for_payment_28kcliz1oevcnqyn9qp7", ) assert_matches_type( InboundRealTimePaymentsTransferSimulationResult, real_time_payments_transfer, path=["response"] diff --git a/tests/api_resources/simulations/test_wire_transfers.py b/tests/api_resources/simulations/test_wire_transfers.py index a313659dd..3b062683c 100644 --- a/tests/api_resources/simulations/test_wire_transfers.py +++ b/tests/api_resources/simulations/test_wire_transfers.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types.simulations import WireTransferSimulation -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -22,16 +22,16 @@ class TestWireTransfers: @parametrize def test_method_create_inbound(self, client: Increase) -> None: wire_transfer = client.simulations.wire_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, ) assert_matches_type(WireTransferSimulation, wire_transfer, path=["response"]) @parametrize def test_method_create_inbound_with_all_params(self, client: Increase) -> None: wire_transfer = client.simulations.wire_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, beneficiary_address_line1="x", beneficiary_address_line2="x", beneficiary_address_line3="x", @@ -58,16 +58,16 @@ class TestAsyncWireTransfers: @parametrize async def test_method_create_inbound(self, client: AsyncIncrease) -> None: wire_transfer = await client.simulations.wire_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, ) assert_matches_type(WireTransferSimulation, wire_transfer, path=["response"]) @parametrize async def test_method_create_inbound_with_all_params(self, client: AsyncIncrease) -> None: wire_transfer = await client.simulations.wire_transfers.create_inbound( - account_number_id="string", - amount=1, + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, beneficiary_address_line1="x", beneficiary_address_line2="x", beneficiary_address_line3="x", diff --git a/tests/api_resources/test_account_numbers.py b/tests/api_resources/test_account_numbers.py index dddf8762c..ff53fdc5d 100644 --- a/tests/api_resources/test_account_numbers.py +++ b/tests/api_resources/test_account_numbers.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,16 +24,16 @@ class TestAccountNumbers: @parametrize def test_method_create(self, client: Increase) -> None: account_number = client.account_numbers.create( - account_id="string", - name="x", + account_id="account_in71c4amph0vgo2qllky", + name="Rent payments", ) assert_matches_type(AccountNumber, account_number, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: account_number = client.account_numbers.create( - account_id="string", - name="x", + account_id="account_in71c4amph0vgo2qllky", + name="Rent payments", inbound_ach={"debit_status": "allowed"}, inbound_checks={"status": "allowed"}, ) @@ -57,9 +57,9 @@ def test_method_update(self, client: Increase) -> None: def test_method_update_with_all_params(self, client: Increase) -> None: account_number = client.account_numbers.update( "string", - inbound_ach={"debit_status": "allowed"}, + inbound_ach={"debit_status": "blocked"}, name="x", - status="active", + status="disabled", ) assert_matches_type(AccountNumber, account_number, path=["response"]) @@ -93,16 +93,16 @@ class TestAsyncAccountNumbers: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: account_number = await client.account_numbers.create( - account_id="string", - name="x", + account_id="account_in71c4amph0vgo2qllky", + name="Rent payments", ) assert_matches_type(AccountNumber, account_number, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: account_number = await client.account_numbers.create( - account_id="string", - name="x", + account_id="account_in71c4amph0vgo2qllky", + name="Rent payments", inbound_ach={"debit_status": "allowed"}, inbound_checks={"status": "allowed"}, ) @@ -126,9 +126,9 @@ async def test_method_update(self, client: AsyncIncrease) -> None: async def test_method_update_with_all_params(self, client: AsyncIncrease) -> None: account_number = await client.account_numbers.update( "string", - inbound_ach={"debit_status": "allowed"}, + inbound_ach={"debit_status": "blocked"}, name="x", - status="active", + status="disabled", ) assert_matches_type(AccountNumber, account_number, path=["response"]) diff --git a/tests/api_resources/test_account_statements.py b/tests/api_resources/test_account_statements.py index 0eddf778c..2b0d1a257 100644 --- a/tests/api_resources/test_account_statements.py +++ b/tests/api_resources/test_account_statements.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_account_transfers.py b/tests/api_resources/test_account_transfers.py index 11f337634..42e3d988c 100644 --- a/tests/api_resources/test_account_transfers.py +++ b/tests/api_resources/test_account_transfers.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,20 +24,20 @@ class TestAccountTransfers: @parametrize def test_method_create(self, client: Increase) -> None: account_transfer = client.account_transfers.create( - account_id="string", - amount=1, - description="x", - destination_account_id="string", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + description="Creating liquidity", + destination_account_id="account_uf16sut2ct5bevmq3eh", ) assert_matches_type(AccountTransfer, account_transfer, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: account_transfer = client.account_transfers.create( - account_id="string", - amount=1, - description="x", - destination_account_id="string", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + description="Creating liquidity", + destination_account_id="account_uf16sut2ct5bevmq3eh", require_approval=True, unique_identifier="x", ) @@ -94,20 +94,20 @@ class TestAsyncAccountTransfers: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: account_transfer = await client.account_transfers.create( - account_id="string", - amount=1, - description="x", - destination_account_id="string", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + description="Creating liquidity", + destination_account_id="account_uf16sut2ct5bevmq3eh", ) assert_matches_type(AccountTransfer, account_transfer, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: account_transfer = await client.account_transfers.create( - account_id="string", - amount=1, - description="x", - destination_account_id="string", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + description="Creating liquidity", + destination_account_id="account_uf16sut2ct5bevmq3eh", require_approval=True, unique_identifier="x", ) diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 57003932c..6df8aa121 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,17 +24,17 @@ class TestAccounts: @parametrize def test_method_create(self, client: Increase) -> None: account = client.accounts.create( - name="x", + name="New Account!", ) assert_matches_type(Account, account, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: account = client.accounts.create( - name="x", - entity_id="string", + name="New Account!", + entity_id="entity_n8y8tnk2p9339ti393yi", informational_entity_id="string", - program_id="string", + program_id="program_i2v2os4mwza1oetokh9i", ) assert_matches_type(Account, account, path=["response"]) @@ -56,7 +56,7 @@ def test_method_update(self, client: Increase) -> None: def test_method_update_with_all_params(self, client: Increase) -> None: account = client.accounts.update( "string", - name="x", + name="My renamed account", ) assert_matches_type(Account, account, path=["response"]) @@ -99,17 +99,17 @@ class TestAsyncAccounts: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: account = await client.accounts.create( - name="x", + name="New Account!", ) assert_matches_type(Account, account, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: account = await client.accounts.create( - name="x", - entity_id="string", + name="New Account!", + entity_id="entity_n8y8tnk2p9339ti393yi", informational_entity_id="string", - program_id="string", + program_id="program_i2v2os4mwza1oetokh9i", ) assert_matches_type(Account, account, path=["response"]) @@ -131,7 +131,7 @@ async def test_method_update(self, client: AsyncIncrease) -> None: async def test_method_update_with_all_params(self, client: AsyncIncrease) -> None: account = await client.accounts.update( "string", - name="x", + name="My renamed account", ) assert_matches_type(Account, account, path=["response"]) diff --git a/tests/api_resources/test_ach_prenotifications.py b/tests/api_resources/test_ach_prenotifications.py index 092ca3ac6..6877d9436 100644 --- a/tests/api_resources/test_ach_prenotifications.py +++ b/tests/api_resources/test_ach_prenotifications.py @@ -12,7 +12,7 @@ from increase._utils import parse_date, parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,16 +24,16 @@ class TestACHPrenotifications: @parametrize def test_method_create(self, client: Increase) -> None: ach_prenotification = client.ach_prenotifications.create( - account_number="x", - routing_number="xxxxxxxxx", + account_number="987654321", + routing_number="101050001", ) assert_matches_type(ACHPrenotification, ach_prenotification, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: ach_prenotification = client.ach_prenotifications.create( - account_number="x", - routing_number="xxxxxxxxx", + account_number="987654321", + routing_number="101050001", addendum="x", company_descriptive_date="x", company_discretionary_data="x", @@ -82,16 +82,16 @@ class TestAsyncACHPrenotifications: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: ach_prenotification = await client.ach_prenotifications.create( - account_number="x", - routing_number="xxxxxxxxx", + account_number="987654321", + routing_number="101050001", ) assert_matches_type(ACHPrenotification, ach_prenotification, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: ach_prenotification = await client.ach_prenotifications.create( - account_number="x", - routing_number="xxxxxxxxx", + account_number="987654321", + routing_number="101050001", addendum="x", company_descriptive_date="x", company_discretionary_data="x", diff --git a/tests/api_resources/test_ach_transfers.py b/tests/api_resources/test_ach_transfers.py index c53fdde3a..19849130e 100644 --- a/tests/api_resources/test_ach_transfers.py +++ b/tests/api_resources/test_ach_transfers.py @@ -12,7 +12,7 @@ from increase._utils import parse_date, parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,19 +24,19 @@ class TestACHTransfers: @parametrize def test_method_create(self, client: Increase) -> None: ach_transfer = client.ach_transfers.create( - account_id="string", - amount=0, - statement_descriptor="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + statement_descriptor="New ACH transfer", ) assert_matches_type(ACHTransfer, ach_transfer, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: ach_transfer = client.ach_transfers.create( - account_id="string", - amount=0, - statement_descriptor="x", - account_number="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + statement_descriptor="New ACH transfer", + account_number="987654321", addendum="x", company_descriptive_date="x", company_discretionary_data="x", @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Increase) -> None: individual_id="x", individual_name="x", require_approval=True, - routing_number="xxxxxxxxx", + routing_number="101050001", standard_entry_class_code="corporate_credit_or_debit", unique_identifier="x", ) @@ -106,19 +106,19 @@ class TestAsyncACHTransfers: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: ach_transfer = await client.ach_transfers.create( - account_id="string", - amount=0, - statement_descriptor="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + statement_descriptor="New ACH transfer", ) assert_matches_type(ACHTransfer, ach_transfer, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: ach_transfer = await client.ach_transfers.create( - account_id="string", - amount=0, - statement_descriptor="x", - account_number="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + statement_descriptor="New ACH transfer", + account_number="987654321", addendum="x", company_descriptive_date="x", company_discretionary_data="x", @@ -130,7 +130,7 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non individual_id="x", individual_name="x", require_approval=True, - routing_number="xxxxxxxxx", + routing_number="101050001", standard_entry_class_code="corporate_credit_or_debit", unique_identifier="x", ) diff --git a/tests/api_resources/test_balance_lookups.py b/tests/api_resources/test_balance_lookups.py index c0689e699..b8b9a51c9 100644 --- a/tests/api_resources/test_balance_lookups.py +++ b/tests/api_resources/test_balance_lookups.py @@ -11,7 +11,7 @@ from increase.types import BalanceLookupLookupResponse from increase._utils import parse_datetime -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,14 +23,14 @@ class TestBalanceLookups: @parametrize def test_method_lookup(self, client: Increase) -> None: balance_lookup = client.balance_lookups.lookup( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(BalanceLookupLookupResponse, balance_lookup, path=["response"]) @parametrize def test_method_lookup_with_all_params(self, client: Increase) -> None: balance_lookup = client.balance_lookups.lookup( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", at_time=parse_datetime("2019-12-27T18:11:19.117Z"), ) assert_matches_type(BalanceLookupLookupResponse, balance_lookup, path=["response"]) @@ -44,14 +44,14 @@ class TestAsyncBalanceLookups: @parametrize async def test_method_lookup(self, client: AsyncIncrease) -> None: balance_lookup = await client.balance_lookups.lookup( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(BalanceLookupLookupResponse, balance_lookup, path=["response"]) @parametrize async def test_method_lookup_with_all_params(self, client: AsyncIncrease) -> None: balance_lookup = await client.balance_lookups.lookup( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", at_time=parse_datetime("2019-12-27T18:11:19.117Z"), ) assert_matches_type(BalanceLookupLookupResponse, balance_lookup, path=["response"]) diff --git a/tests/api_resources/test_bookkeeping_accounts.py b/tests/api_resources/test_bookkeeping_accounts.py index 5b4239785..9502d2df3 100644 --- a/tests/api_resources/test_bookkeeping_accounts.py +++ b/tests/api_resources/test_bookkeeping_accounts.py @@ -11,7 +11,7 @@ from increase.types import BookkeepingAccount from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,14 +23,14 @@ class TestBookkeepingAccounts: @parametrize def test_method_create(self, client: Increase) -> None: bookkeeping_account = client.bookkeeping_accounts.create( - name="x", + name="New Account!", ) assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: bookkeeping_account = client.bookkeeping_accounts.create( - name="x", + name="New Account!", account_id="string", compliance_category="commingled_cash", entity_id="string", @@ -59,14 +59,14 @@ class TestAsyncBookkeepingAccounts: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: bookkeeping_account = await client.bookkeeping_accounts.create( - name="x", + name="New Account!", ) assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: bookkeeping_account = await client.bookkeeping_accounts.create( - name="x", + name="New Account!", account_id="string", compliance_category="commingled_cash", entity_id="string", diff --git a/tests/api_resources/test_bookkeeping_entries.py b/tests/api_resources/test_bookkeeping_entries.py index 6fa475d7e..27012d0af 100644 --- a/tests/api_resources/test_bookkeeping_entries.py +++ b/tests/api_resources/test_bookkeeping_entries.py @@ -11,7 +11,7 @@ from increase.types import BookkeepingEntry from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_bookkeeping_entry_sets.py b/tests/api_resources/test_bookkeeping_entry_sets.py index 4b64e8ce1..dbf2869a9 100644 --- a/tests/api_resources/test_bookkeeping_entry_sets.py +++ b/tests/api_resources/test_bookkeeping_entry_sets.py @@ -11,7 +11,7 @@ from increase.types import BookkeepingEntrySet from increase._utils import parse_datetime -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -25,16 +25,12 @@ def test_method_create(self, client: Increase) -> None: bookkeeping_entry_set = client.bookkeeping_entry_sets.create( entries=[ { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", + "amount": 100, }, { - "account_id": "string", - "amount": 0, - }, - { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", + "amount": -100, }, ], ) @@ -45,20 +41,16 @@ def test_method_create_with_all_params(self, client: Increase) -> None: bookkeeping_entry_set = client.bookkeeping_entry_sets.create( entries=[ { - "account_id": "string", - "amount": 0, - }, - { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", + "amount": 100, }, { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", + "amount": -100, }, ], - date=parse_datetime("2019-12-27T18:11:19.117Z"), - transaction_id="string", + date=parse_datetime("2020-01-31T23:59:59Z"), + transaction_id="transaction_uyrp7fld2ium70oa7oi", ) assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) @@ -73,16 +65,12 @@ async def test_method_create(self, client: AsyncIncrease) -> None: bookkeeping_entry_set = await client.bookkeeping_entry_sets.create( entries=[ { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", + "amount": 100, }, { - "account_id": "string", - "amount": 0, - }, - { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", + "amount": -100, }, ], ) @@ -93,19 +81,15 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non bookkeeping_entry_set = await client.bookkeeping_entry_sets.create( entries=[ { - "account_id": "string", - "amount": 0, - }, - { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", + "amount": 100, }, { - "account_id": "string", - "amount": 0, + "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", + "amount": -100, }, ], - date=parse_datetime("2019-12-27T18:11:19.117Z"), - transaction_id="string", + date=parse_datetime("2020-01-31T23:59:59Z"), + transaction_id="transaction_uyrp7fld2ium70oa7oi", ) assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) diff --git a/tests/api_resources/test_card_disputes.py b/tests/api_resources/test_card_disputes.py index 3bc57a819..ed0f813c8 100644 --- a/tests/api_resources/test_card_disputes.py +++ b/tests/api_resources/test_card_disputes.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,8 +24,8 @@ class TestCardDisputes: @parametrize def test_method_create(self, client: Increase) -> None: card_dispute = client.card_disputes.create( - disputed_transaction_id="string", - explanation="x", + disputed_transaction_id="transaction_uyrp7fld2ium70oa7oi", + explanation="Unauthorized recurring transaction.", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -65,8 +65,8 @@ class TestAsyncCardDisputes: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: card_dispute = await client.card_disputes.create( - disputed_transaction_id="string", - explanation="x", + disputed_transaction_id="transaction_uyrp7fld2ium70oa7oi", + explanation="Unauthorized recurring transaction.", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) diff --git a/tests/api_resources/test_card_payments.py b/tests/api_resources/test_card_payments.py index 8b5c72156..ea3020bda 100644 --- a/tests/api_resources/test_card_payments.py +++ b/tests/api_resources/test_card_payments.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_card_profiles.py b/tests/api_resources/test_card_profiles.py index fa34152a4..83c0fc7f2 100644 --- a/tests/api_resources/test_card_profiles.py +++ b/tests/api_resources/test_card_profiles.py @@ -11,7 +11,7 @@ from increase.types import CardProfile from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,12 +23,12 @@ class TestCardProfiles: @parametrize def test_method_create(self, client: Increase) -> None: card_profile = client.card_profiles.create( - description="x", + description="My Card Profile", digital_wallets={ - "issuer_name": "x", - "card_description": "x", - "background_image_file_id": "string", - "app_icon_file_id": "string", + "issuer_name": "MyBank", + "card_description": "MyBank Signature Card", + "background_image_file_id": "file_1ai913suu1zfn1pdetru", + "app_icon_file_id": "file_8zxqkwlh43wo144u8yec", }, ) assert_matches_type(CardProfile, card_profile, path=["response"]) @@ -36,20 +36,20 @@ def test_method_create(self, client: Increase) -> None: @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: card_profile = client.card_profiles.create( - description="x", + description="My Card Profile", digital_wallets={ "text_color": { - "red": 0, - "green": 0, - "blue": 0, + "red": 26, + "green": 43, + "blue": 59, }, - "issuer_name": "x", - "card_description": "x", - "contact_website": "string", - "contact_email": "x", - "contact_phone": "x", - "background_image_file_id": "string", - "app_icon_file_id": "string", + "issuer_name": "MyBank", + "card_description": "MyBank Signature Card", + "contact_website": "https://example.com", + "contact_email": "user@example.com", + "contact_phone": "+18885551212", + "background_image_file_id": "file_1ai913suu1zfn1pdetru", + "app_icon_file_id": "file_8zxqkwlh43wo144u8yec", }, physical_cards={ "contact_phone": "x", @@ -97,12 +97,12 @@ class TestAsyncCardProfiles: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: card_profile = await client.card_profiles.create( - description="x", + description="My Card Profile", digital_wallets={ - "issuer_name": "x", - "card_description": "x", - "background_image_file_id": "string", - "app_icon_file_id": "string", + "issuer_name": "MyBank", + "card_description": "MyBank Signature Card", + "background_image_file_id": "file_1ai913suu1zfn1pdetru", + "app_icon_file_id": "file_8zxqkwlh43wo144u8yec", }, ) assert_matches_type(CardProfile, card_profile, path=["response"]) @@ -110,20 +110,20 @@ async def test_method_create(self, client: AsyncIncrease) -> None: @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: card_profile = await client.card_profiles.create( - description="x", + description="My Card Profile", digital_wallets={ "text_color": { - "red": 0, - "green": 0, - "blue": 0, + "red": 26, + "green": 43, + "blue": 59, }, - "issuer_name": "x", - "card_description": "x", - "contact_website": "string", - "contact_email": "x", - "contact_phone": "x", - "background_image_file_id": "string", - "app_icon_file_id": "string", + "issuer_name": "MyBank", + "card_description": "MyBank Signature Card", + "contact_website": "https://example.com", + "contact_email": "user@example.com", + "contact_phone": "+18885551212", + "background_image_file_id": "file_1ai913suu1zfn1pdetru", + "app_icon_file_id": "file_8zxqkwlh43wo144u8yec", }, physical_cards={ "contact_phone": "x", diff --git a/tests/api_resources/test_card_purchase_supplements.py b/tests/api_resources/test_card_purchase_supplements.py index b096de5b6..3df0e32f4 100644 --- a/tests/api_resources/test_card_purchase_supplements.py +++ b/tests/api_resources/test_card_purchase_supplements.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_cards.py b/tests/api_resources/test_cards.py index 5f64e8cd2..221e5b0f7 100644 --- a/tests/api_resources/test_cards.py +++ b/tests/api_resources/test_cards.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,14 +24,14 @@ class TestCards: @parametrize def test_method_create(self, client: Increase) -> None: card = client.cards.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(Card, card, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: card = client.cards.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", billing_address={ "line1": "x", "line2": "x", @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Increase) -> None: "state": "x", "postal_code": "x", }, - description="x", + description="Card for Ian Crease", digital_wallet={ "email": "x", "phone": "x", @@ -74,7 +74,7 @@ def test_method_update_with_all_params(self, client: Increase) -> None: "state": "x", "postal_code": "x", }, - description="x", + description="New description", digital_wallet={ "email": "x", "phone": "x", @@ -121,14 +121,14 @@ class TestAsyncCards: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: card = await client.cards.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", ) assert_matches_type(Card, card, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: card = await client.cards.create( - account_id="string", + account_id="account_in71c4amph0vgo2qllky", billing_address={ "line1": "x", "line2": "x", @@ -136,7 +136,7 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non "state": "x", "postal_code": "x", }, - description="x", + description="Card for Ian Crease", digital_wallet={ "email": "x", "phone": "x", @@ -171,7 +171,7 @@ async def test_method_update_with_all_params(self, client: AsyncIncrease) -> Non "state": "x", "postal_code": "x", }, - description="x", + description="New description", digital_wallet={ "email": "x", "phone": "x", diff --git a/tests/api_resources/test_check_deposits.py b/tests/api_resources/test_check_deposits.py index 61a3bd55d..7a71b1ea1 100644 --- a/tests/api_resources/test_check_deposits.py +++ b/tests/api_resources/test_check_deposits.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,11 +24,11 @@ class TestCheckDeposits: @parametrize def test_method_create(self, client: Increase) -> None: check_deposit = client.check_deposits.create( - account_id="string", - amount=0, - back_image_file_id="string", - currency="x", - front_image_file_id="string", + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + back_image_file_id="file_26khfk98mzfz90a11oqx", + currency="USD", + front_image_file_id="file_hkv175ovmc2tb2v2zbrm", ) assert_matches_type(CheckDeposit, check_deposit, path=["response"]) @@ -68,11 +68,11 @@ class TestAsyncCheckDeposits: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: check_deposit = await client.check_deposits.create( - account_id="string", - amount=0, - back_image_file_id="string", - currency="x", - front_image_file_id="string", + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + back_image_file_id="file_26khfk98mzfz90a11oqx", + currency="USD", + front_image_file_id="file_hkv175ovmc2tb2v2zbrm", ) assert_matches_type(CheckDeposit, check_deposit, path=["response"]) diff --git a/tests/api_resources/test_check_transfers.py b/tests/api_resources/test_check_transfers.py index f92959197..7733c41be 100644 --- a/tests/api_resources/test_check_transfers.py +++ b/tests/api_resources/test_check_transfers.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,40 +24,40 @@ class TestCheckTransfers: @parametrize def test_method_create(self, client: Increase) -> None: check_transfer = client.check_transfers.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, ) assert_matches_type(CheckTransfer, check_transfer, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: check_transfer = client.check_transfers.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, fulfillment_method="physical_check", physical_check={ - "memo": "x", + "memo": "Check payment", "note": "x", - "recipient_name": "x", + "recipient_name": "Ian Crease", "mailing_address": { - "name": "x", - "line1": "x", + "name": "Ian Crease", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "postal_code": "x", + "city": "New York", + "state": "NY", + "postal_code": "10045", }, "return_address": { - "name": "x", - "line1": "x", + "name": "Ian Crease", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "postal_code": "x", + "city": "New York", + "state": "NY", + "postal_code": "10045", }, }, require_approval=True, - source_account_number_id="string", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", unique_identifier="x", ) assert_matches_type(CheckTransfer, check_transfer, path=["response"]) @@ -130,40 +130,40 @@ class TestAsyncCheckTransfers: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: check_transfer = await client.check_transfers.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, ) assert_matches_type(CheckTransfer, check_transfer, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: check_transfer = await client.check_transfers.create( - account_id="string", - amount=1, + account_id="account_in71c4amph0vgo2qllky", + amount=1000, fulfillment_method="physical_check", physical_check={ - "memo": "x", + "memo": "Check payment", "note": "x", - "recipient_name": "x", + "recipient_name": "Ian Crease", "mailing_address": { - "name": "x", - "line1": "x", + "name": "Ian Crease", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "postal_code": "x", + "city": "New York", + "state": "NY", + "postal_code": "10045", }, "return_address": { - "name": "x", - "line1": "x", + "name": "Ian Crease", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "postal_code": "x", + "city": "New York", + "state": "NY", + "postal_code": "10045", }, }, require_approval=True, - source_account_number_id="string", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", unique_identifier="x", ) assert_matches_type(CheckTransfer, check_transfer, path=["response"]) diff --git a/tests/api_resources/test_declined_transactions.py b/tests/api_resources/test_declined_transactions.py index 8a123fc46..fa440a831 100644 --- a/tests/api_resources/test_declined_transactions.py +++ b/tests/api_resources/test_declined_transactions.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_digital_wallet_tokens.py b/tests/api_resources/test_digital_wallet_tokens.py index 2389fd4a3..32a6b9c59 100644 --- a/tests/api_resources/test_digital_wallet_tokens.py +++ b/tests/api_resources/test_digital_wallet_tokens.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_documents.py b/tests/api_resources/test_documents.py index 4efbc90da..42645c4b7 100644 --- a/tests/api_resources/test_documents.py +++ b/tests/api_resources/test_documents.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_entities.py b/tests/api_resources/test_entities.py index d79a07d78..2939dd2a1 100644 --- a/tests/api_resources/test_entities.py +++ b/tests/api_resources/test_entities.py @@ -12,7 +12,7 @@ from increase._utils import parse_date, parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -33,109 +33,33 @@ def test_method_create_with_all_params(self, client: Increase) -> None: entity = client.entities.create( structure="corporation", corporation={ - "name": "x", - "website": "string", - "tax_identifier": "x", - "incorporation_state": "x", + "name": "National Phonograph Company", + "website": "https://example.com", + "tax_identifier": "602214076", + "incorporation_state": "NY", "address": { - "line1": "x", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "city": "New York", + "state": "NY", + "zip": "10045", }, "beneficial_owners": [ { "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), - "address": { - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", - }, - "confirmed_no_us_tax_id": True, - "identification": { - "method": "social_security_number", - "number": "xxxx", - "passport": { - "file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "country": "x", - }, - "drivers_license": { - "file_id": "string", - "back_file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "state": "x", - }, - "other": { - "country": "x", - "description": "x", - "expiration_date": parse_date("2019-12-27"), - "file_id": "string", - "back_file_id": "string", - }, - }, - }, - "company_title": "x", - "prongs": ["ownership", "control"], - }, - { - "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), - "address": { - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", - }, - "confirmed_no_us_tax_id": True, - "identification": { - "method": "social_security_number", - "number": "xxxx", - "passport": { - "file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "country": "x", - }, - "drivers_license": { - "file_id": "string", - "back_file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "state": "x", - }, - "other": { - "country": "x", - "description": "x", - "expiration_date": parse_date("2019-12-27"), - "file_id": "string", - "back_file_id": "string", - }, - }, - }, - "company_title": "x", - "prongs": ["ownership", "control"], - }, - { - "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), + "name": "Ian Crease", + "date_of_birth": parse_date("1970-01-31"), "address": { - "line1": "x", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "city": "New York", + "state": "NY", + "zip": "10045", }, "confirmed_no_us_tax_id": True, "identification": { "method": "social_security_number", - "number": "xxxx", + "number": "078051120", "passport": { "file_id": "string", "expiration_date": parse_date("2019-12-27"), @@ -156,9 +80,9 @@ def test_method_create_with_all_params(self, client: Increase) -> None: }, }, }, - "company_title": "x", - "prongs": ["ownership", "control"], - }, + "company_title": "CEO", + "prongs": ["control"], + } ], }, description="x", @@ -304,7 +228,7 @@ def test_method_create_with_all_params(self, client: Increase) -> None: }, }, relationship="affiliated", - supplemental_documents=[{"file_id": "string"}, {"file_id": "string"}, {"file_id": "string"}], + supplemental_documents=[{"file_id": "file_makxrc67oh9l6sg7w9yc"}], trust={ "name": "x", "category": "revocable", @@ -492,6 +416,7 @@ def test_method_list_with_all_params(self, client: Increase) -> None: }, cursor="string", limit=0, + status={"in": ["active", "archived", "disabled"]}, ) assert_matches_type(SyncPage[Entity], entity, path=["response"]) @@ -507,10 +432,10 @@ def test_method_update_address(self, client: Increase) -> None: entity = client.entities.update_address( "string", address={ - "line1": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "zip": "10045", }, ) assert_matches_type(Entity, entity, path=["response"]) @@ -520,11 +445,11 @@ def test_method_update_address_with_all_params(self, client: Increase) -> None: entity = client.entities.update_address( "string", address={ - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "line2": "Unit 2", + "city": "New York", + "state": "NY", + "zip": "10045", }, ) assert_matches_type(Entity, entity, path=["response"]) @@ -547,109 +472,33 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non entity = await client.entities.create( structure="corporation", corporation={ - "name": "x", - "website": "string", - "tax_identifier": "x", - "incorporation_state": "x", + "name": "National Phonograph Company", + "website": "https://example.com", + "tax_identifier": "602214076", + "incorporation_state": "NY", "address": { - "line1": "x", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "city": "New York", + "state": "NY", + "zip": "10045", }, "beneficial_owners": [ { "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), - "address": { - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", - }, - "confirmed_no_us_tax_id": True, - "identification": { - "method": "social_security_number", - "number": "xxxx", - "passport": { - "file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "country": "x", - }, - "drivers_license": { - "file_id": "string", - "back_file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "state": "x", - }, - "other": { - "country": "x", - "description": "x", - "expiration_date": parse_date("2019-12-27"), - "file_id": "string", - "back_file_id": "string", - }, - }, - }, - "company_title": "x", - "prongs": ["ownership", "control"], - }, - { - "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), - "address": { - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", - }, - "confirmed_no_us_tax_id": True, - "identification": { - "method": "social_security_number", - "number": "xxxx", - "passport": { - "file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "country": "x", - }, - "drivers_license": { - "file_id": "string", - "back_file_id": "string", - "expiration_date": parse_date("2019-12-27"), - "state": "x", - }, - "other": { - "country": "x", - "description": "x", - "expiration_date": parse_date("2019-12-27"), - "file_id": "string", - "back_file_id": "string", - }, - }, - }, - "company_title": "x", - "prongs": ["ownership", "control"], - }, - { - "individual": { - "name": "x", - "date_of_birth": parse_date("2019-12-27"), + "name": "Ian Crease", + "date_of_birth": parse_date("1970-01-31"), "address": { - "line1": "x", + "line1": "33 Liberty Street", "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "city": "New York", + "state": "NY", + "zip": "10045", }, "confirmed_no_us_tax_id": True, "identification": { "method": "social_security_number", - "number": "xxxx", + "number": "078051120", "passport": { "file_id": "string", "expiration_date": parse_date("2019-12-27"), @@ -670,9 +519,9 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non }, }, }, - "company_title": "x", - "prongs": ["ownership", "control"], - }, + "company_title": "CEO", + "prongs": ["control"], + } ], }, description="x", @@ -818,7 +667,7 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non }, }, relationship="affiliated", - supplemental_documents=[{"file_id": "string"}, {"file_id": "string"}, {"file_id": "string"}], + supplemental_documents=[{"file_id": "file_makxrc67oh9l6sg7w9yc"}], trust={ "name": "x", "category": "revocable", @@ -1006,6 +855,7 @@ async def test_method_list_with_all_params(self, client: AsyncIncrease) -> None: }, cursor="string", limit=0, + status={"in": ["active", "archived", "disabled"]}, ) assert_matches_type(AsyncPage[Entity], entity, path=["response"]) @@ -1021,10 +871,10 @@ async def test_method_update_address(self, client: AsyncIncrease) -> None: entity = await client.entities.update_address( "string", address={ - "line1": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "zip": "10045", }, ) assert_matches_type(Entity, entity, path=["response"]) @@ -1034,11 +884,11 @@ async def test_method_update_address_with_all_params(self, client: AsyncIncrease entity = await client.entities.update_address( "string", address={ - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + "line1": "33 Liberty Street", + "line2": "Unit 2", + "city": "New York", + "state": "NY", + "zip": "10045", }, ) assert_matches_type(Entity, entity, path=["response"]) diff --git a/tests/api_resources/test_event_subscriptions.py b/tests/api_resources/test_event_subscriptions.py index c81cb15e4..a475e451b 100644 --- a/tests/api_resources/test_event_subscriptions.py +++ b/tests/api_resources/test_event_subscriptions.py @@ -11,7 +11,7 @@ from increase.types import EventSubscription from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,14 +23,14 @@ class TestEventSubscriptions: @parametrize def test_method_create(self, client: Increase) -> None: event_subscription = client.event_subscriptions.create( - url="string", + url="https://website.com/webhooks", ) assert_matches_type(EventSubscription, event_subscription, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: event_subscription = client.event_subscriptions.create( - url="string", + url="https://website.com/webhooks", selected_event_category="account.created", shared_secret="x", ) @@ -80,14 +80,14 @@ class TestAsyncEventSubscriptions: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: event_subscription = await client.event_subscriptions.create( - url="string", + url="https://website.com/webhooks", ) assert_matches_type(EventSubscription, event_subscription, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: event_subscription = await client.event_subscriptions.create( - url="string", + url="https://website.com/webhooks", selected_event_category="account.created", shared_secret="x", ) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index fb0020ab8..1d569e2d1 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_exports.py b/tests/api_resources/test_exports.py index 08cc4aed1..1c19c4e4c 100644 --- a/tests/api_resources/test_exports.py +++ b/tests/api_resources/test_exports.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,14 +24,14 @@ class TestExports: @parametrize def test_method_create(self, client: Increase) -> None: export = client.exports.create( - category="account_statement_ofx", + category="transaction_csv", ) assert_matches_type(Export, export, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: export = client.exports.create( - category="account_statement_ofx", + category="transaction_csv", account_statement_ofx={ "account_id": "string", "created_at": { @@ -51,7 +51,7 @@ def test_method_create_with_all_params(self, client: Increase) -> None: }, }, transaction_csv={ - "account_id": "string", + "account_id": "account_in71c4amph0vgo2qllky", "created_at": { "after": parse_datetime("2019-12-27T18:11:19.117Z"), "before": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -91,14 +91,14 @@ class TestAsyncExports: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: export = await client.exports.create( - category="account_statement_ofx", + category="transaction_csv", ) assert_matches_type(Export, export, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: export = await client.exports.create( - category="account_statement_ofx", + category="transaction_csv", account_statement_ofx={ "account_id": "string", "created_at": { @@ -118,7 +118,7 @@ async def test_method_create_with_all_params(self, client: AsyncIncrease) -> Non }, }, transaction_csv={ - "account_id": "string", + "account_id": "account_in71c4amph0vgo2qllky", "created_at": { "after": parse_datetime("2019-12-27T18:11:19.117Z"), "before": parse_datetime("2019-12-27T18:11:19.117Z"), diff --git a/tests/api_resources/test_external_accounts.py b/tests/api_resources/test_external_accounts.py index dbb8fc646..803c0b472 100644 --- a/tests/api_resources/test_external_accounts.py +++ b/tests/api_resources/test_external_accounts.py @@ -11,7 +11,7 @@ from increase.types import ExternalAccount from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -23,18 +23,18 @@ class TestExternalAccounts: @parametrize def test_method_create(self, client: Increase) -> None: external_account = client.external_accounts.create( - account_number="x", - description="x", - routing_number="xxxxxxxxx", + account_number="987654321", + description="Landlord", + routing_number="101050001", ) assert_matches_type(ExternalAccount, external_account, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: external_account = client.external_accounts.create( - account_number="x", - description="x", - routing_number="xxxxxxxxx", + account_number="987654321", + description="Landlord", + routing_number="101050001", funding="checking", ) assert_matches_type(ExternalAccount, external_account, path=["response"]) @@ -57,7 +57,7 @@ def test_method_update(self, client: Increase) -> None: def test_method_update_with_all_params(self, client: Increase) -> None: external_account = client.external_accounts.update( "string", - description="x", + description="New description", status="active", ) assert_matches_type(ExternalAccount, external_account, path=["response"]) @@ -86,18 +86,18 @@ class TestAsyncExternalAccounts: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: external_account = await client.external_accounts.create( - account_number="x", - description="x", - routing_number="xxxxxxxxx", + account_number="987654321", + description="Landlord", + routing_number="101050001", ) assert_matches_type(ExternalAccount, external_account, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: external_account = await client.external_accounts.create( - account_number="x", - description="x", - routing_number="xxxxxxxxx", + account_number="987654321", + description="Landlord", + routing_number="101050001", funding="checking", ) assert_matches_type(ExternalAccount, external_account, path=["response"]) @@ -120,7 +120,7 @@ async def test_method_update(self, client: AsyncIncrease) -> None: async def test_method_update_with_all_params(self, client: AsyncIncrease) -> None: external_account = await client.external_accounts.update( "string", - description="x", + description="New description", status="active", ) assert_matches_type(ExternalAccount, external_account, path=["response"]) diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index 4de508e6d..7e13d0b76 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 3294f49ad..0897a9168 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import Group -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_inbound_ach_transfers.py b/tests/api_resources/test_inbound_ach_transfers.py index 26f0db524..dd5178914 100644 --- a/tests/api_resources/test_inbound_ach_transfers.py +++ b/tests/api_resources/test_inbound_ach_transfers.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -67,8 +67,8 @@ def test_method_notification_of_change(self, client: Increase) -> None: def test_method_notification_of_change_with_all_params(self, client: Increase) -> None: inbound_ach_transfer = client.inbound_ach_transfers.notification_of_change( "string", - updated_account_number="x", - updated_routing_number="x", + updated_account_number="987654321", + updated_routing_number="101050001", ) assert_matches_type(InboundACHTransfer, inbound_ach_transfer, path=["response"]) @@ -76,7 +76,7 @@ def test_method_notification_of_change_with_all_params(self, client: Increase) - def test_method_transfer_return(self, client: Increase) -> None: inbound_ach_transfer = client.inbound_ach_transfers.transfer_return( "string", - reason="authorization_revoked_by_customer", + reason="payment_stopped", ) assert_matches_type(InboundACHTransfer, inbound_ach_transfer, path=["response"]) @@ -132,8 +132,8 @@ async def test_method_notification_of_change(self, client: AsyncIncrease) -> Non async def test_method_notification_of_change_with_all_params(self, client: AsyncIncrease) -> None: inbound_ach_transfer = await client.inbound_ach_transfers.notification_of_change( "string", - updated_account_number="x", - updated_routing_number="x", + updated_account_number="987654321", + updated_routing_number="101050001", ) assert_matches_type(InboundACHTransfer, inbound_ach_transfer, path=["response"]) @@ -141,6 +141,6 @@ async def test_method_notification_of_change_with_all_params(self, client: Async async def test_method_transfer_return(self, client: AsyncIncrease) -> None: inbound_ach_transfer = await client.inbound_ach_transfers.transfer_return( "string", - reason="authorization_revoked_by_customer", + reason="payment_stopped", ) assert_matches_type(InboundACHTransfer, inbound_ach_transfer, path=["response"]) diff --git a/tests/api_resources/test_inbound_wire_drawdown_requests.py b/tests/api_resources/test_inbound_wire_drawdown_requests.py index 4dec16e32..3610ff93a 100644 --- a/tests/api_resources/test_inbound_wire_drawdown_requests.py +++ b/tests/api_resources/test_inbound_wire_drawdown_requests.py @@ -11,7 +11,7 @@ from increase.types import InboundWireDrawdownRequest from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_oauth_connections.py b/tests/api_resources/test_oauth_connections.py index 2d20fe35a..561773b3c 100644 --- a/tests/api_resources/test_oauth_connections.py +++ b/tests/api_resources/test_oauth_connections.py @@ -11,7 +11,7 @@ from increase.types import OauthConnection from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_pending_transactions.py b/tests/api_resources/test_pending_transactions.py index aa8ca5e7b..27fb486e6 100644 --- a/tests/api_resources/test_pending_transactions.py +++ b/tests/api_resources/test_pending_transactions.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_physical_cards.py b/tests/api_resources/test_physical_cards.py index bf10c76cd..ab2cc7220 100644 --- a/tests/api_resources/test_physical_cards.py +++ b/tests/api_resources/test_physical_cards.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,20 +24,20 @@ class TestPhysicalCards: @parametrize def test_method_create(self, client: Increase) -> None: physical_card = client.physical_cards.create( - card_id="string", - card_profile_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", + card_profile_id="card_profile_cox5y73lob2eqly18piy", cardholder={ - "first_name": "x", - "last_name": "x", + "first_name": "Ian", + "last_name": "Crease", }, shipment={ "method": "usps", "address": { - "name": "x", - "line1": "x", - "city": "x", - "state": "x", - "postal_code": "x", + "name": "Ian Crease", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "postal_code": "10045", }, }, ) @@ -54,7 +54,7 @@ def test_method_retrieve(self, client: Increase) -> None: def test_method_update(self, client: Increase) -> None: physical_card = client.physical_cards.update( "string", - status="active", + status="disabled", ) assert_matches_type(PhysicalCard, physical_card, path=["response"]) @@ -87,20 +87,20 @@ class TestAsyncPhysicalCards: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: physical_card = await client.physical_cards.create( - card_id="string", - card_profile_id="string", + card_id="card_oubs0hwk5rn6knuecxg2", + card_profile_id="card_profile_cox5y73lob2eqly18piy", cardholder={ - "first_name": "x", - "last_name": "x", + "first_name": "Ian", + "last_name": "Crease", }, shipment={ "method": "usps", "address": { - "name": "x", - "line1": "x", - "city": "x", - "state": "x", - "postal_code": "x", + "name": "Ian Crease", + "line1": "33 Liberty Street", + "city": "New York", + "state": "NY", + "postal_code": "10045", }, }, ) @@ -117,7 +117,7 @@ async def test_method_retrieve(self, client: AsyncIncrease) -> None: async def test_method_update(self, client: AsyncIncrease) -> None: physical_card = await client.physical_cards.update( "string", - status="active", + status="disabled", ) assert_matches_type(PhysicalCard, physical_card, path=["response"]) diff --git a/tests/api_resources/test_programs.py b/tests/api_resources/test_programs.py index 0ea50944a..565647541 100644 --- a/tests/api_resources/test_programs.py +++ b/tests/api_resources/test_programs.py @@ -11,7 +11,7 @@ from increase.types import Program from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_real_time_decisions.py b/tests/api_resources/test_real_time_decisions.py index 989ed3839..aa4c495f9 100644 --- a/tests/api_resources/test_real_time_decisions.py +++ b/tests/api_resources/test_real_time_decisions.py @@ -10,7 +10,7 @@ from tests.utils import assert_matches_type from increase.types import RealTimeDecision -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_real_time_payments_transfers.py b/tests/api_resources/test_real_time_payments_transfers.py index 8e53d2413..a899c7a99 100644 --- a/tests/api_resources/test_real_time_payments_transfers.py +++ b/tests/api_resources/test_real_time_payments_transfers.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,22 +24,22 @@ class TestRealTimePaymentsTransfers: @parametrize def test_method_create(self, client: Increase) -> None: real_time_payments_transfer = client.real_time_payments_transfers.create( - amount=1, - creditor_name="x", - remittance_information="x", - source_account_number_id="string", + amount=100, + creditor_name="Ian Crease", + remittance_information="Invoice 29582", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", ) assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: real_time_payments_transfer = client.real_time_payments_transfers.create( - amount=1, - creditor_name="x", - remittance_information="x", - source_account_number_id="string", - destination_account_number="x", - destination_routing_number="xxxxxxxxx", + amount=100, + creditor_name="Ian Crease", + remittance_information="Invoice 29582", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + destination_account_number="987654321", + destination_routing_number="101050001", external_account_id="string", require_approval=True, unique_identifier="x", @@ -84,22 +84,22 @@ class TestAsyncRealTimePaymentsTransfers: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: real_time_payments_transfer = await client.real_time_payments_transfers.create( - amount=1, - creditor_name="x", - remittance_information="x", - source_account_number_id="string", + amount=100, + creditor_name="Ian Crease", + remittance_information="Invoice 29582", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", ) assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: real_time_payments_transfer = await client.real_time_payments_transfers.create( - amount=1, - creditor_name="x", - remittance_information="x", - source_account_number_id="string", - destination_account_number="x", - destination_routing_number="xxxxxxxxx", + amount=100, + creditor_name="Ian Crease", + remittance_information="Invoice 29582", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + destination_account_number="987654321", + destination_routing_number="101050001", external_account_id="string", require_approval=True, unique_identifier="x", diff --git a/tests/api_resources/test_routing_numbers.py b/tests/api_resources/test_routing_numbers.py index 49cc91642..f063f6c07 100644 --- a/tests/api_resources/test_routing_numbers.py +++ b/tests/api_resources/test_routing_numbers.py @@ -11,7 +11,7 @@ from increase.types import RoutingNumber from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_transactions.py b/tests/api_resources/test_transactions.py index 6f2344c4f..1e8278792 100644 --- a/tests/api_resources/test_transactions.py +++ b/tests/api_resources/test_transactions.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") diff --git a/tests/api_resources/test_wire_drawdown_requests.py b/tests/api_resources/test_wire_drawdown_requests.py index 1f5d21137..579fcba96 100644 --- a/tests/api_resources/test_wire_drawdown_requests.py +++ b/tests/api_resources/test_wire_drawdown_requests.py @@ -11,7 +11,7 @@ from increase.types import WireDrawdownRequest from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,12 +24,12 @@ class TestWireDrawdownRequests: @parametrize def test_method_create(self, client: Increase) -> None: wire_drawdown_request = client.wire_drawdown_requests.create( - account_number_id="string", - amount=1, - message_to_recipient="x", - recipient_account_number="x", - recipient_name="x", - recipient_routing_number="x", + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=10000, + message_to_recipient="Invoice 29582", + recipient_account_number="987654321", + recipient_name="Ian Crease", + recipient_routing_number="101050001", ) assert_matches_type(WireDrawdownRequest, wire_drawdown_request, path=["response"]) @@ -37,14 +37,14 @@ def test_method_create(self, client: Increase) -> None: @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: wire_drawdown_request = client.wire_drawdown_requests.create( - account_number_id="string", - amount=1, - message_to_recipient="x", - recipient_account_number="x", - recipient_name="x", - recipient_routing_number="x", - recipient_address_line1="x", - recipient_address_line2="x", + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=10000, + message_to_recipient="Invoice 29582", + recipient_account_number="987654321", + recipient_name="Ian Crease", + recipient_routing_number="101050001", + recipient_address_line1="33 Liberty Street", + recipient_address_line2="New York, NY, 10045", recipient_address_line3="x", ) assert_matches_type(WireDrawdownRequest, wire_drawdown_request, path=["response"]) @@ -79,12 +79,12 @@ class TestAsyncWireDrawdownRequests: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: wire_drawdown_request = await client.wire_drawdown_requests.create( - account_number_id="string", - amount=1, - message_to_recipient="x", - recipient_account_number="x", - recipient_name="x", - recipient_routing_number="x", + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=10000, + message_to_recipient="Invoice 29582", + recipient_account_number="987654321", + recipient_name="Ian Crease", + recipient_routing_number="101050001", ) assert_matches_type(WireDrawdownRequest, wire_drawdown_request, path=["response"]) @@ -92,14 +92,14 @@ async def test_method_create(self, client: AsyncIncrease) -> None: @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: wire_drawdown_request = await client.wire_drawdown_requests.create( - account_number_id="string", - amount=1, - message_to_recipient="x", - recipient_account_number="x", - recipient_name="x", - recipient_routing_number="x", - recipient_address_line1="x", - recipient_address_line2="x", + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=10000, + message_to_recipient="Invoice 29582", + recipient_account_number="987654321", + recipient_name="Ian Crease", + recipient_routing_number="101050001", + recipient_address_line1="33 Liberty Street", + recipient_address_line2="New York, NY, 10045", recipient_address_line3="x", ) assert_matches_type(WireDrawdownRequest, wire_drawdown_request, path=["response"]) diff --git a/tests/api_resources/test_wire_transfers.py b/tests/api_resources/test_wire_transfers.py index c9e49c8fd..67579fc63 100644 --- a/tests/api_resources/test_wire_transfers.py +++ b/tests/api_resources/test_wire_transfers.py @@ -12,7 +12,7 @@ from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -24,27 +24,27 @@ class TestWireTransfers: @parametrize def test_method_create(self, client: Increase) -> None: wire_transfer = client.wire_transfers.create( - account_id="string", - amount=1, - beneficiary_name="x", - message_to_recipient="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + beneficiary_name="Ian Crease", + message_to_recipient="New account transfer", ) assert_matches_type(WireTransfer, wire_transfer, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Increase) -> None: wire_transfer = client.wire_transfers.create( - account_id="string", - amount=1, - beneficiary_name="x", - message_to_recipient="x", - account_number="x", - beneficiary_address_line1="x", - beneficiary_address_line2="x", - beneficiary_address_line3="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + beneficiary_name="Ian Crease", + message_to_recipient="New account transfer", + account_number="987654321", + beneficiary_address_line1="33 Liberty Street", + beneficiary_address_line2="New York", + beneficiary_address_line3="NY 10045", external_account_id="string", require_approval=True, - routing_number="xxxxxxxxx", + routing_number="101050001", unique_identifier="x", ) assert_matches_type(WireTransfer, wire_transfer, path=["response"]) @@ -117,27 +117,27 @@ class TestAsyncWireTransfers: @parametrize async def test_method_create(self, client: AsyncIncrease) -> None: wire_transfer = await client.wire_transfers.create( - account_id="string", - amount=1, - beneficiary_name="x", - message_to_recipient="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + beneficiary_name="Ian Crease", + message_to_recipient="New account transfer", ) assert_matches_type(WireTransfer, wire_transfer, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: wire_transfer = await client.wire_transfers.create( - account_id="string", - amount=1, - beneficiary_name="x", - message_to_recipient="x", - account_number="x", - beneficiary_address_line1="x", - beneficiary_address_line2="x", - beneficiary_address_line3="x", + account_id="account_in71c4amph0vgo2qllky", + amount=100, + beneficiary_name="Ian Crease", + message_to_recipient="New account transfer", + account_number="987654321", + beneficiary_address_line1="33 Liberty Street", + beneficiary_address_line2="New York", + beneficiary_address_line3="NY 10045", external_account_id="string", require_approval=True, - routing_number="xxxxxxxxx", + routing_number="101050001", unique_identifier="x", ) assert_matches_type(WireTransfer, wire_transfer, path=["response"]) diff --git a/tests/test_client.py b/tests/test_client.py index 6bff279ea..d4ae2e29b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -7,6 +7,7 @@ import asyncio import inspect from typing import Any, Dict, Union, cast +from unittest import mock import httpx import pytest @@ -18,7 +19,7 @@ from increase._exceptions import APIResponseValidationError from increase._base_client import BaseClient, make_request_options -base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = os.environ.get("API_KEY", "something1234") @@ -424,6 +425,33 @@ class Model(BaseModel): response = client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + @pytest.mark.parametrize( + "remaining_retries,retry_after,timeout", + [ + [3, "20", 20], + [3, "0", 2], + [3, "-10", 2], + [3, "60", 60], + [3, "61", 2], + [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 2], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 2], + [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 2], + [3, "99999999999999999999999999999999999", 2], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 2], + [3, "", 2], + ], + ) + @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) + def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: + client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) + + headers = httpx.Headers({"retry-after": retry_after}) + options = FinalRequestOptions(method="get", url="/foo", max_retries=2) + calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + assert calculated == pytest.approx(timeout, 0.6) # pyright: ignore[reportUnknownMemberType] + class TestAsyncIncrease: client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) @@ -824,3 +852,31 @@ class Model(BaseModel): response = await client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + + @pytest.mark.parametrize( + "remaining_retries,retry_after,timeout", + [ + [3, "20", 20], + [3, "0", 2], + [3, "-10", 2], + [3, "60", 60], + [3, "61", 2], + [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 2], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 2], + [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 2], + [3, "99999999999999999999999999999999999", 2], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 2], + [3, "", 2], + ], + ) + @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) + @pytest.mark.asyncio + async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: + client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) + + headers = httpx.Headers({"retry-after": retry_after}) + options = FinalRequestOptions(method="get", url="/foo", max_retries=2) + calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + assert calculated == pytest.approx(timeout, 0.6) # pyright: ignore[reportUnknownMemberType]