-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from gocardless/template-changes
Changes generated by 69082df64fd97438839e8a0a8e855f389d359d50
- Loading branch information
Showing
62 changed files
with
3,361 additions
and
4,525 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
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
from .client import Client | ||
|
||
__version__ = '1.46.1' | ||
__version__ = '1.46.2' | ||
|
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
responses>=0.10.16;python_version>"3.4" | ||
responses<0.10.16;python_version<="3.4" | ||
nose>=1.3.6 | ||
pytest | ||
pytest |
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
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 |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# WARNING: Do not edit by hand, this file was generated by Crank: | ||
# | ||
# https://github.com/gocardless/crank | ||
# | ||
|
||
import pytest | ||
import requests | ||
import responses | ||
|
||
from gocardless_pro import Client | ||
from gocardless_pro import services | ||
|
||
access_token = 'access-token-xyz' | ||
client = Client(access_token=access_token, base_url='http://example.com') | ||
|
||
def test_requires_valid_environment(): | ||
with pytest.raises(ValueError): | ||
Client(access_token=access_token, environment='invalid') | ||
|
||
|
||
def test_bank_authorisations_returns_service(): | ||
assert isinstance(client.bank_authorisations, services.BankAuthorisationsService) | ||
|
||
def test_bank_details_lookups_returns_service(): | ||
assert isinstance(client.bank_details_lookups, services.BankDetailsLookupsService) | ||
|
||
def test_billing_requests_returns_service(): | ||
assert isinstance(client.billing_requests, services.BillingRequestsService) | ||
|
||
def test_billing_request_flows_returns_service(): | ||
assert isinstance(client.billing_request_flows, services.BillingRequestFlowsService) | ||
|
||
def test_billing_request_templates_returns_service(): | ||
assert isinstance(client.billing_request_templates, services.BillingRequestTemplatesService) | ||
|
||
def test_blocks_returns_service(): | ||
assert isinstance(client.blocks, services.BlocksService) | ||
|
||
def test_creditors_returns_service(): | ||
assert isinstance(client.creditors, services.CreditorsService) | ||
|
||
def test_creditor_bank_accounts_returns_service(): | ||
assert isinstance(client.creditor_bank_accounts, services.CreditorBankAccountsService) | ||
|
||
def test_currency_exchange_rates_returns_service(): | ||
assert isinstance(client.currency_exchange_rates, services.CurrencyExchangeRatesService) | ||
|
||
def test_customers_returns_service(): | ||
assert isinstance(client.customers, services.CustomersService) | ||
|
||
def test_customer_bank_accounts_returns_service(): | ||
assert isinstance(client.customer_bank_accounts, services.CustomerBankAccountsService) | ||
|
||
def test_customer_notifications_returns_service(): | ||
assert isinstance(client.customer_notifications, services.CustomerNotificationsService) | ||
|
||
def test_events_returns_service(): | ||
assert isinstance(client.events, services.EventsService) | ||
|
||
def test_instalment_schedules_returns_service(): | ||
assert isinstance(client.instalment_schedules, services.InstalmentSchedulesService) | ||
|
||
def test_institutions_returns_service(): | ||
assert isinstance(client.institutions, services.InstitutionsService) | ||
|
||
def test_mandates_returns_service(): | ||
assert isinstance(client.mandates, services.MandatesService) | ||
|
||
def test_mandate_imports_returns_service(): | ||
assert isinstance(client.mandate_imports, services.MandateImportsService) | ||
|
||
def test_mandate_import_entries_returns_service(): | ||
assert isinstance(client.mandate_import_entries, services.MandateImportEntriesService) | ||
|
||
def test_mandate_pdfs_returns_service(): | ||
assert isinstance(client.mandate_pdfs, services.MandatePdfsService) | ||
|
||
def test_negative_balance_limits_returns_service(): | ||
assert isinstance(client.negative_balance_limits, services.NegativeBalanceLimitsService) | ||
|
||
def test_payer_authorisations_returns_service(): | ||
assert isinstance(client.payer_authorisations, services.PayerAuthorisationsService) | ||
|
||
def test_payments_returns_service(): | ||
assert isinstance(client.payments, services.PaymentsService) | ||
|
||
def test_payouts_returns_service(): | ||
assert isinstance(client.payouts, services.PayoutsService) | ||
|
||
def test_payout_items_returns_service(): | ||
assert isinstance(client.payout_items, services.PayoutItemsService) | ||
|
||
def test_redirect_flows_returns_service(): | ||
assert isinstance(client.redirect_flows, services.RedirectFlowsService) | ||
|
||
def test_refunds_returns_service(): | ||
assert isinstance(client.refunds, services.RefundsService) | ||
|
||
def test_scenario_simulators_returns_service(): | ||
assert isinstance(client.scenario_simulators, services.ScenarioSimulatorsService) | ||
|
||
def test_scheme_identifiers_returns_service(): | ||
assert isinstance(client.scheme_identifiers, services.SchemeIdentifiersService) | ||
|
||
def test_subscriptions_returns_service(): | ||
assert isinstance(client.subscriptions, services.SubscriptionsService) | ||
|
||
def test_tax_rates_returns_service(): | ||
assert isinstance(client.tax_rates, services.TaxRatesService) | ||
|
||
def test_verification_details_returns_service(): | ||
assert isinstance(client.verification_details, services.VerificationDetailsService) | ||
|
||
def test_webhooks_returns_service(): | ||
assert isinstance(client.webhooks, services.WebhooksService) | ||
|
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# WARNING: Do not edit by hand, this file was generated by Crank: | ||
# | ||
# https://github.com/gocardless/crank | ||
# | ||
|
||
from gocardless_pro import errors | ||
|
||
from . import helpers | ||
|
||
def test_invalid_state_error_message(): | ||
fixture = helpers.load_fixture('invalid_state_error') | ||
response_errors = fixture.get('error').get('errors', []) | ||
error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) | ||
assert errors.InvalidStateError == error | ||
error = error(fixture['error']) | ||
assert str(error) == 'Mandate is already active or being submitted' | ||
|
||
def test_invalid_api_usage_message(): | ||
fixture = helpers.load_fixture('invalid_api_usage_error') | ||
response_errors = fixture.get('error').get('errors', []) | ||
error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) | ||
assert errors.InvalidApiUsageError == error | ||
error = error(fixture['error']) | ||
assert str(error) == 'Invalid document structure (Root element must be an object.)' | ||
|
||
def test_validation_failed_message(): | ||
fixture = helpers.load_fixture('validation_failed_error') | ||
response_errors = fixture.get('error').get('errors', []) | ||
error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) | ||
assert errors.ValidationFailedError == error | ||
error = error(fixture['error']) | ||
|
||
branch_error = 'branch_code must be a number /customer_bank_accounts/branch_code' | ||
country_error = 'country_code is invalid /customer_bank_accounts/country_code' | ||
|
||
expected = f'Validation failed ({branch_error}, {country_error})' | ||
assert str(error) == expected | ||
|
||
def test_validation_failed_duplicate_bank_account_message(): | ||
fixture = helpers.load_fixture('validation_failed_duplicate_bank_account_error') | ||
response_errors = fixture.get('error').get('errors', []) | ||
error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) | ||
assert errors.ValidationFailedError == error | ||
error = error(fixture['error']) | ||
assert str(error) == 'Bank account already exists' | ||
|
||
def test_gocardless_error_message(): | ||
fixture = helpers.load_fixture('gocardless_error') | ||
response_errors = fixture.get('error').get('errors', []) | ||
error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) | ||
assert errors.GoCardlessInternalError == error | ||
error = error(fixture['error']) | ||
assert str(error) == 'Uh-oh!' | ||
|
||
def test_idempotent_creation_conflict_error_message(): | ||
fixture = helpers.idempotent_creation_conflict_body('PM00001078ZJJN') | ||
error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], fixture['error']['errors']) | ||
assert errors.IdempotentCreationConflictError == error | ||
error = error(fixture['error']) | ||
assert str(error) == 'None (A resource has already been created with this idempotency key)' | ||
assert error.conflicting_resource_id == "PM00001078ZJJN" |
Oops, something went wrong.