-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add kyc_results into broker account (#467)
- Loading branch information
Showing
2 changed files
with
72 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ def test_create_account(reqmock, client: BrokerClient): | |
assert reqmock.called_once | ||
assert type(returned_account) == Account | ||
assert returned_account.id == UUID(created_id) | ||
assert returned_account.kyc_results is None | ||
|
||
|
||
def test_create_lct_account(reqmock, client: BrokerClient): | ||
|
@@ -209,7 +210,8 @@ def test_create_lct_account(reqmock, client: BrokerClient): | |
}, | ||
"account_type": "trading", | ||
"trading_configurations": null, | ||
"currency": "EUR" | ||
"currency": "EUR", | ||
"kyc_results": null | ||
} | ||
""", | ||
) | ||
|
@@ -232,6 +234,7 @@ def test_create_lct_account(reqmock, client: BrokerClient): | |
assert type(returned_account) == Account | ||
assert returned_account.id == UUID(created_id) | ||
assert returned_account.currency == currency | ||
assert returned_account.kyc_results is None | ||
|
||
|
||
def test_get_account(reqmock, client: BrokerClient): | ||
|
@@ -316,7 +319,14 @@ def test_get_account(reqmock, client: BrokerClient): | |
"email_address": "[email protected]" | ||
}, | ||
"account_type": "trading", | ||
"trading_configurations": null | ||
"trading_configurations": null, | ||
"kyc_results": { | ||
"reject": {"IDENTITY_VERIFICATION": {}}, | ||
"accept": {"IDENTITY_VERIFICATION": {}}, | ||
"indeterminate": {"IDENTITY_VERIFICATION": {}}, | ||
"additional_information": "additional_information_test", | ||
"summary": "pass" | ||
} | ||
} | ||
""", | ||
) | ||
|
@@ -327,6 +337,13 @@ def test_get_account(reqmock, client: BrokerClient): | |
assert type(account) == Account | ||
assert account.id == UUID(account_id) | ||
|
||
assert account.kyc_results is not None | ||
assert account.kyc_results.reject == {"IDENTITY_VERIFICATION": {}} | ||
assert account.kyc_results.accept == {"IDENTITY_VERIFICATION": {}} | ||
assert account.kyc_results.indeterminate == {"IDENTITY_VERIFICATION": {}} | ||
assert account.kyc_results.additional_information == "additional_information_test" | ||
assert account.kyc_results.summary == "pass" | ||
|
||
|
||
def test_get_account_account_not_found(reqmock, client: BrokerClient): | ||
account_id = "2a87c088-ffb6-472b-a4a3-cd9305c8605c" | ||
|
@@ -473,6 +490,13 @@ def test_update_account(reqmock, client: BrokerClient): | |
assert account.id == UUID(account_id) | ||
assert account.identity.family_name == family_name | ||
|
||
assert account.kyc_results is not None | ||
assert account.kyc_results.reject == {} | ||
assert account.kyc_results.accept == {} | ||
assert account.kyc_results.indeterminate == {} | ||
assert account.kyc_results.additional_information is None | ||
assert account.kyc_results.summary == "pass" | ||
|
||
|
||
def test_update_account_validates_account_id(reqmock, client: BrokerClient): | ||
# dummy update request just to test param parsing | ||
|
@@ -604,6 +628,13 @@ def test_list_accounts_no_params(reqmock, client: BrokerClient): | |
assert account.trusted_contact is None | ||
assert account.agreements is None | ||
|
||
assert account.kyc_results is not None | ||
assert account.kyc_results.reject == {} | ||
assert account.kyc_results.accept == {} | ||
assert account.kyc_results.indeterminate == {} | ||
assert account.kyc_results.additional_information is None | ||
assert account.kyc_results.summary == "pass" | ||
|
||
|
||
def test_list_accounts_parses_entities_if_present(reqmock, client: BrokerClient): | ||
reqmock.get( | ||
|
@@ -724,6 +755,13 @@ def test_list_accounts_parses_entities_if_present(reqmock, client: BrokerClient) | |
assert account.trusted_contact is None | ||
assert account.agreements is None | ||
|
||
assert account.kyc_results is not None | ||
assert account.kyc_results.reject == {} | ||
assert account.kyc_results.accept == {} | ||
assert account.kyc_results.indeterminate == {} | ||
assert account.kyc_results.additional_information is None | ||
assert account.kyc_results.summary == "pass" | ||
|
||
|
||
def test_get_trade_account_by_id(reqmock, client: BrokerClient): | ||
account_id = "5fc0795e-1f16-40cc-aa90-ede67c39d7a9" | ||
|