def test_entity_kyc_data(): kyc_data = offchain.entity_kyc_data( given_name="hello", surname="world", address=offchain.AddressObject(city="San Francisco"), legal_entity_name="foo bar", ) assert kyc_data.type == offchain.KycDataObjectType.entity
@pytest.mark.parametrize("amount", [0, 1, 100, 10000000000]) @pytest.mark.parametrize("currency", ["XUS"]) def test_create_an_account_with_initial_deposit_balances(target_client: RestClient, currency: str, amount: int) -> None: account = target_client.create_account(kyc_data=None, balances={currency: amount}) assert account.id assert account.kyc_data is None assert account.balance(currency) == amount @pytest.mark.parametrize( # pyre-ignore "kyc_data", [ offchain.to_json(offchain.individual_kyc_data()), offchain.to_json(offchain.entity_kyc_data()), ], ) def test_create_an_account_with_minimum_valid_kyc_data(target_client: RestClient, kyc_data: str) -> None: account = target_client.create_account(kyc_data=kyc_data) assert account.id assert account.kyc_data == kyc_data def test_create_an_account_with_valid_kyc_data_and_initial_deposit_balances( target_client: RestClient, currency: str ) -> None: minimum_kyc_data = offchain.to_json(offchain.individual_kyc_data()) account = target_client.create_account(kyc_data=minimum_kyc_data, balances={currency: 123}) assert account.id assert account.kyc_data == minimum_kyc_data
@pytest.mark.parametrize("amount", [0, 1, 100, 10000000000]) @pytest.mark.parametrize("currency", ["XUS"]) async def test_create_an_account_with_initial_deposit_balances( target_client: RestClient, currency: str, amount: int ) -> None: account = await target_client.create_account(kyc_data=None, balances={currency: amount}) assert account.id assert await account.balance(currency) == amount @pytest.mark.parametrize( # pyre-ignore "kyc_data", [ offchain.individual_kyc_data(), offchain.entity_kyc_data(), ], ) async def test_create_an_account_with_minimum_valid_kyc_data( target_client: RestClient, kyc_data: offchain.KycDataObject ) -> None: account = await target_client.create_account(kyc_data=kyc_data) assert account.id async def test_create_an_account_with_valid_kyc_data_and_initial_deposit_balances( target_client: RestClient, currency: str ) -> None: minimum_kyc_data = offchain.individual_kyc_data() account = await target_client.create_account(kyc_data=minimum_kyc_data, balances={currency: 123}) assert account.id