Skip to content

Commit 8380e1f

Browse files
committed
fix tests, bump version
1 parent acace4d commit 8380e1f

9 files changed

Lines changed: 111 additions & 216 deletions

File tree

method/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def __init__(self, config: Configuration):
147147
'Authorization': 'Bearer {token}'.format(token=config.api_key),
148148
'Content-Type': 'application/json',
149149
'User-Agent': 'Method-Python/v{version}'.format(version=version('method-python')),
150-
'method-version': '2025-07-04'
150+
'method-version': '2026-03-30'
151151
})
152152

153153
def _make_request(self, method: str, path: Optional[str] = None, data: Optional[Dict] = None, params: Optional[Dict] = None, headers: Optional[Dict] = None, raw: bool = False, download: bool = False) -> Union[MethodResponse[T], str]:

method/resources/Accounts/Account.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class AccountLiabilityCreateOpts(AccountCreateOpts):
5454
class Account(TypedDict):
5555
id: str
5656
holder_id: str
57+
consent_status: Optional[str]
5758
status: AccountStatusesLiterals
5859
type: AccountTypesLiterals
5960
ach: Optional[AccountACH]

method/resources/Secrets/Secret.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import TypedDict, Optional, Dict, Any, Literal, List
22

33
from method.resource import MethodResponse, Resource, RequestOpts, ResourceListOpts
4+
from method.errors import ResourceError
45
from method.configuration import Configuration
56

67

@@ -12,8 +13,9 @@
1213

1314
class Secret(TypedDict):
1415
id: str
15-
metadata: Optional[Dict[str, Any]]
1616
status: SecretStatusesLiterals
17+
error: Optional[ResourceError]
18+
metadata: Optional[Dict[str, Any]]
1719
created_at: str
1820
updated_at: str
1921

method/resources/Teams/Team.py

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,30 @@
1212
]
1313

1414

15-
class TeamProduct(TypedDict):
16-
type: str
17-
enabled: bool
15+
class TeamContact(TypedDict):
16+
name: Optional[str]
17+
email: Optional[str]
18+
type: Optional[str]
1819

1920

20-
class TeamKey(TypedDict):
21-
id: str
22-
type: Literal['secret', 'public']
23-
deleted: bool
24-
created_at: str
25-
updated_at: str
26-
last_used_at: Optional[str]
21+
class TeamAddress(TypedDict):
22+
line1: Optional[str]
23+
city: Optional[str]
24+
state: Optional[str]
25+
zipcode: Optional[str]
26+
country: Optional[str]
2727

2828

2929
class Team(TypedDict):
3030
id: str
3131
parent_id: Optional[str]
3232
name: str
3333
legal_name: str
34-
logo: Optional[str]
35-
api_version: str
34+
ein: Optional[str]
35+
contacts: List[TeamContact]
36+
address: TeamAddress
3637
status: TeamStatusesLiterals
37-
products: List[TeamProduct]
38-
keys: List[TeamKey]
38+
logo: Optional[str]
3939
created_at: str
4040
updated_at: str
4141

@@ -48,15 +48,25 @@ class TeamEncryptionKeyOpts(TypedDict):
4848
key: str
4949

5050

51+
MLEPublicKeyTypesLiterals = Literal['direct', 'well_known']
52+
53+
5154
class MLEPublicKey(TypedDict):
5255
id: str
53-
jwk: Dict[str, Any]
56+
type: MLEPublicKeyTypesLiterals
57+
jwk: Optional[Dict[str, Any]]
58+
well_known_endpoint: Optional[str]
59+
contact: str
60+
status: str
5461
created_at: str
5562
updated_at: str
5663

5764

5865
class MLEPublicKeyCreateOpts(TypedDict):
59-
jwk: Dict[str, Any]
66+
type: MLEPublicKeyTypesLiterals
67+
contact: str
68+
jwk: Optional[Dict[str, Any]]
69+
well_known_endpoint: Optional[str]
6070

6171

6272
class TeamPublicKeysResource(Resource):

test/resources/Account_test.py

Lines changed: 17 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def test_create_ach_account(setup):
118118
expect_results: Account = {
119119
'id': accounts_create_ach_response['id'],
120120
'holder_id': holder_1_response['id'],
121+
'consent_status': accounts_create_ach_response['consent_status'],
121122
'type': 'ach',
122123
'ach': {
123124
'routing': '062103000',
@@ -127,9 +128,6 @@ def test_create_ach_account(setup):
127128
'latest_verification_session': accounts_create_ach_response['latest_verification_session'],
128129
'products': ['payment'],
129130
'restricted_products': [],
130-
'subscriptions': [],
131-
'available_subscriptions': [],
132-
'restricted_subscriptions': [],
133131
'status': 'active',
134132
'error': None,
135133
'metadata': None,
@@ -155,14 +153,15 @@ def test_create_liability_account(setup):
155153
expect_results: Account = {
156154
'id': accounts_create_liability_response['id'],
157155
'holder_id': holder_1_response['id'],
156+
'consent_status': accounts_create_liability_response['consent_status'],
158157
'type': 'liability',
159158
'liability': {
160159
'fingerprint': None,
161160
'mch_id': 'mch_302086',
162161
'mask': '8721',
163162
'ownership': 'unknown',
164163
'type': 'credit_card',
165-
'name': 'Chase Sapphire Reserve',
164+
'name': 'Chase Credit Card',
166165
'sub_type': 'flexible_spending',
167166
},
168167
'latest_verification_session': accounts_create_liability_response['latest_verification_session'],
@@ -175,7 +174,7 @@ def test_create_liability_account(setup):
175174
'restricted_products': accounts_create_liability_response['restricted_products'],
176175
'subscriptions': accounts_create_liability_response['subscriptions'],
177176
'available_subscriptions': [ 'update' ],
178-
'restricted_subscriptions': [],
177+
'restricted_subscriptions': accounts_create_liability_response['restricted_subscriptions'],
179178
'status': 'active',
180179
'error': None,
181180
'metadata': None,
@@ -192,6 +191,7 @@ def test_retrieve_account(setup):
192191
expect_results: Account = {
193192
'id': accounts_create_ach_response['id'],
194193
'holder_id': setup['holder_1_response']['id'],
194+
'consent_status': accounts_retrieve_response['consent_status'],
195195
'type': 'ach',
196196
'ach': {
197197
'routing': '062103000',
@@ -201,9 +201,6 @@ def test_retrieve_account(setup):
201201
'latest_verification_session': accounts_create_ach_response['latest_verification_session'],
202202
'products': ['payment'],
203203
'restricted_products': [],
204-
'subscriptions': [],
205-
'available_subscriptions': [],
206-
'restricted_subscriptions': [],
207204
'status': 'active',
208205
'error': None,
209206
'metadata': None,
@@ -1067,117 +1064,18 @@ def test_list_account_products(setup):
10671064

10681065
account_products_list_response = method.accounts(test_credit_card_account['id']).products.list()
10691066

1070-
expect_results: AccountProductListResponse = {
1071-
'balance': {
1072-
'name': 'balance',
1073-
'status': 'available',
1074-
'status_error': None,
1075-
'latest_request_id': account_products_list_response.get('balance', {}).get('latest_request_id', None),
1076-
'latest_successful_request_id': account_products_list_response.get('balance', {}).get('latest_successful_request_id', None),
1077-
'is_subscribable': False,
1078-
'created_at': account_products_list_response.get('balance', {}).get('created_at', ''),
1079-
'updated_at': account_products_list_response.get('balance', {}).get('updated_at', ''),
1080-
},
1081-
'payment': {
1082-
'name': 'payment',
1083-
'status': 'available',
1084-
'status_error': None,
1085-
'latest_request_id': account_products_list_response.get('payment', {}).get('latest_request_id', None),
1086-
'latest_successful_request_id': account_products_list_response.get('payment', {}).get('latest_successful_request_id', None),
1087-
'is_subscribable': False,
1088-
'created_at': account_products_list_response.get('payment', {}).get('created_at', ''),
1089-
'updated_at': account_products_list_response.get('payment', {}).get('updated_at', ''),
1090-
},
1091-
'sensitive': {
1092-
'name': 'sensitive',
1093-
'status': 'available',
1094-
'status_error': None,
1095-
'latest_request_id': account_products_list_response.get('sensitive', {}).get('latest_request_id', None),
1096-
'latest_successful_request_id': account_products_list_response.get('sensitive', {}).get('latest_successful_request_id', None),
1097-
'is_subscribable': False,
1098-
'created_at': account_products_list_response.get('sensitive', {}).get('created_at', ''),
1099-
'updated_at': account_products_list_response.get('sensitive', {}).get('updated_at', ''),
1100-
},
1101-
'update': {
1102-
'name': 'update',
1103-
'status': 'available',
1104-
'status_error': None,
1105-
'latest_request_id': account_products_list_response.get('update', {}).get('latest_request_id', None),
1106-
'latest_successful_request_id': account_products_list_response.get('update', {}).get('latest_successful_request_id', None),
1107-
'is_subscribable': True,
1108-
'created_at': account_products_list_response.get('update', {}).get('created_at', ''),
1109-
'updated_at': account_products_list_response.get('update', {}).get('updated_at', ''),
1110-
},
1111-
'attribute': {
1112-
'name': 'attribute',
1113-
'status': 'available',
1114-
'status_error': None,
1115-
'latest_request_id': account_products_list_response.get('attribute', {}).get('latest_request_id', None),
1116-
'latest_successful_request_id': account_products_list_response.get('attribute', {}).get('latest_successful_request_id', None),
1117-
'is_subscribable': False,
1118-
'created_at': account_products_list_response.get('attribute', {}).get('created_at', ''),
1119-
'updated_at': account_products_list_response.get('attribute', {}).get('updated_at', ''),
1120-
},
1121-
'transaction': {
1122-
'name': 'transaction',
1123-
'status': 'unavailable',
1124-
'status_error': account_products_list_response.get('transaction', {}).get('status_error', None),
1125-
'latest_request_id': account_products_list_response.get('transaction', {}).get('latest_request_id', None),
1126-
'latest_successful_request_id': account_products_list_response.get('transaction', {}).get('latest_successful_request_id', None),
1127-
'is_subscribable': True,
1128-
'created_at': account_products_list_response.get('transaction', {}).get('created_at', ''),
1129-
'updated_at': account_products_list_response.get('transaction', {}).get('updated_at', ''),
1130-
},
1131-
'payoff': {
1132-
'name': 'payoff',
1133-
'status': 'unavailable',
1134-
'status_error': account_products_list_response.get('payoff', {}).get('status_error', None),
1135-
'latest_request_id': account_products_list_response.get('payoff', {}).get('latest_request_id', None),
1136-
'latest_successful_request_id': account_products_list_response.get('payoff', {}).get('latest_successful_request_id', None),
1137-
'is_subscribable': False,
1138-
'created_at': account_products_list_response.get('payoff', {}).get('created_at', ''),
1139-
'updated_at': account_products_list_response.get('payoff', {}).get('updated_at', ''),
1140-
},
1141-
'card_brand': {
1142-
'name': 'card_brand',
1143-
'status': 'available',
1144-
'status_error': None,
1145-
'latest_request_id': account_products_list_response.get('card_brand', {}).get('latest_request_id', None),
1146-
'latest_successful_request_id': account_products_list_response.get('card_brand', {}).get('latest_successful_request_id', None),
1147-
'is_subscribable': True,
1148-
'created_at': account_products_list_response.get('card_brand', {}).get('created_at', ''),
1149-
'updated_at': account_products_list_response.get('card_brand', {}).get('updated_at', ''),
1150-
},
1151-
'payment_instrument.card': {
1152-
'name': 'payment_instrument.card',
1153-
'status': 'restricted',
1154-
'status_error': account_products_list_response.get('payment_instrument.card', {}).get('status_error', None),
1155-
'latest_request_id': account_products_list_response.get('payment_instrument.card', {}).get('latest_request_id', None),
1156-
'latest_successful_request_id': account_products_list_response.get('payment_instrument.card', {}).get('latest_successful_request_id', None),
1157-
'is_subscribable': True,
1158-
'created_at': account_products_list_response.get('payment_instrument.card', {}).get('created_at', ''),
1159-
'updated_at': account_products_list_response.get('payment_instrument.card', {}).get('updated_at', ''),
1160-
},
1161-
'payment_instrument.inbound_achwire_payment': {
1162-
'name': 'payment_instrument.inbound_achwire_payment',
1163-
'status': 'restricted',
1164-
'status_error': account_products_list_response.get('payment_instrument.inbound_achwire_payment', {}).get('status_error', None),
1165-
'latest_request_id': account_products_list_response.get('payment_instrument.inbound_achwire_payment', {}).get('latest_request_id', None),
1166-
'latest_successful_request_id': account_products_list_response.get('payment_instrument.inbound_achwire_payment', {}).get('latest_successful_request_id', None),
1167-
'is_subscribable': False,
1168-
'created_at': account_products_list_response.get('payment_instrument.inbound_achwire_payment', {}).get('created_at', ''),
1169-
'updated_at': account_products_list_response.get('payment_instrument.inbound_achwire_payment', {}).get('updated_at', ''),
1170-
},
1171-
'payment_instrument.network_token': {
1172-
'name': 'payment_instrument.network_token',
1173-
'status': 'restricted',
1174-
'status_error': account_products_list_response.get('payment_instrument.network_token', {}).get('status_error', None),
1175-
'latest_request_id': account_products_list_response.get('payment_instrument.network_token', {}).get('latest_request_id', None),
1176-
'latest_successful_request_id': account_products_list_response.get('payment_instrument.network_token', {}).get('latest_successful_request_id', None),
1177-
'is_subscribable': True,
1178-
'created_at': account_products_list_response.get('payment_instrument.network_token', {}).get('created_at', ''),
1179-
'updated_at': account_products_list_response.get('payment_instrument.network_token', {}).get('updated_at', ''),
1067+
expect_results = {
1068+
name: {
1069+
'name': name,
1070+
'status': product.get('status'),
1071+
'status_error': product.get('status_error'),
1072+
'latest_request_id': product.get('latest_request_id'),
1073+
'latest_successful_request_id': product.get('latest_successful_request_id'),
1074+
'is_subscribable': product.get('is_subscribable'),
1075+
'created_at': product.get('created_at'),
1076+
'updated_at': product.get('updated_at'),
11801077
}
1078+
for name, product in account_products_list_response.items()
11811079
}
11821080

11831081
assert account_products_list_response == expect_results
@@ -1191,6 +1089,7 @@ def test_withdraw_account_consent(setup):
11911089
expect_results: Account = {
11921090
'id': withdraw_consent_response['id'],
11931091
'holder_id': holder_1_response['id'],
1092+
'consent_status': withdraw_consent_response['consent_status'],
11941093
'status': 'disabled',
11951094
'type': None,
11961095
'liability': None,

test/resources/Entity_test.py

Lines changed: 11 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -877,67 +877,18 @@ def test_retrieve_entity_product_list():
877877
global entities_retrieve_product_list_response
878878
entities_retrieve_product_list_response = method.entities(entities_create_response['id']).products.list()
879879

880-
expect_results: EntityProductListResponse = {
881-
'connect': {
882-
'name': 'connect',
883-
'status': 'available',
884-
'status_error': None,
885-
'latest_request_id': entities_retrieve_product_list_response.get('connect', {}).get('latest_request_id', None),
886-
'latest_successful_request_id': entities_retrieve_product_list_response.get('connect', {}).get('latest_successful_request_id', None),
887-
'is_subscribable': True,
888-
'created_at': entities_retrieve_product_list_response.get('connect', {}).get('created_at', ''),
889-
'updated_at': entities_retrieve_product_list_response.get('connect', {}).get('updated_at', ''),
890-
},
891-
'credit_score': {
892-
'name': 'credit_score',
893-
'status': 'available',
894-
'status_error': None,
895-
'latest_request_id': entities_retrieve_product_list_response.get('credit_score', {}).get('latest_request_id', None),
896-
'latest_successful_request_id': entities_retrieve_product_list_response.get('credit_score', {}).get('latest_successful_request_id', None),
897-
'is_subscribable': True,
898-
'created_at': entities_retrieve_product_list_response.get('credit_score', {}).get('created_at', ''),
899-
'updated_at': entities_retrieve_product_list_response.get('credit_score', {}).get('updated_at', ''),
900-
},
901-
'identity': {
902-
'name': 'identity',
903-
'status': 'available',
904-
'status_error': None,
905-
'latest_request_id': entities_retrieve_product_list_response.get('identity', {}).get('latest_request_id', None),
906-
'latest_successful_request_id': entities_retrieve_product_list_response.get('identity', {}).get('latest_successful_request_id', None),
907-
'is_subscribable': False,
908-
'created_at': entities_retrieve_product_list_response.get('identity', {}).get('created_at', ''),
909-
'updated_at': entities_retrieve_product_list_response.get('identity', {}).get('updated_at', ''),
910-
},
911-
'attribute': {
912-
'name': 'attribute',
913-
'status': 'available',
914-
'status_error': None,
915-
'latest_request_id': entities_retrieve_product_list_response.get('attribute', {}).get('latest_request_id', None),
916-
'latest_successful_request_id': entities_retrieve_product_list_response.get('attribute', {}).get('latest_successful_request_id', None),
917-
'is_subscribable': True,
918-
'created_at': entities_retrieve_product_list_response.get('attribute', {}).get('created_at', ''),
919-
'updated_at': entities_retrieve_product_list_response.get('attribute', {}).get('updated_at', ''),
920-
},
921-
'vehicle': {
922-
'name': 'vehicle',
923-
'status': 'available',
924-
'status_error': None,
925-
'latest_request_id': entities_retrieve_product_list_response.get('vehicle', {}).get('latest_request_id', None),
926-
'latest_successful_request_id': entities_retrieve_product_list_response.get('vehicle', {}).get('latest_successful_request_id', None),
927-
'is_subscribable': False,
928-
'created_at': entities_retrieve_product_list_response.get('vehicle', {}).get('created_at', ''),
929-
'updated_at': entities_retrieve_product_list_response.get('vehicle', {}).get('updated_at', ''),
930-
},
931-
'manual_connect': {
932-
'name': 'manual_connect',
933-
'status': 'restricted',
934-
'status_error': entities_retrieve_product_list_response.get('manual_connect', {}).get('status_error', None),
935-
'latest_request_id': entities_retrieve_product_list_response.get('manual_connect', {}).get('latest_request_id', None),
936-
'latest_successful_request_id': entities_retrieve_product_list_response.get('manual_connect', {}).get('latest_successful_request_id', None),
937-
'is_subscribable': False,
938-
'created_at': entities_retrieve_product_list_response.get('manual_connect', {}).get('created_at', ''),
939-
'updated_at': entities_retrieve_product_list_response.get('manual_connect', {}).get('updated_at', ''),
880+
expect_results = {
881+
name: {
882+
'name': name,
883+
'status': product.get('status'),
884+
'status_error': product.get('status_error'),
885+
'latest_request_id': product.get('latest_request_id'),
886+
'latest_successful_request_id': product.get('latest_successful_request_id'),
887+
'is_subscribable': product.get('is_subscribable'),
888+
'created_at': product.get('created_at'),
889+
'updated_at': product.get('updated_at'),
940890
}
891+
for name, product in entities_retrieve_product_list_response.items()
941892
}
942893

943894
assert entities_retrieve_product_list_response == expect_results

0 commit comments

Comments
 (0)