Skip to content

Commit

Permalink
Fix typo in arcus_error (#152)
Browse files Browse the repository at this point in the history
* fix typo error

* Update version.py
  • Loading branch information
pachCode authored Feb 15, 2022
1 parent c45f8e3 commit 62fa724
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arcus/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def __init__(self, **kwargs):
R16=FailedConsult,
R17=InvalidAmount,
R18=LimitExceeded,
R19=InvalidBiller,
R19=UnprocessableEntity,
R20=InvalidBiller,
R21=InvalidBiller,
R22=BillerMaintenance,
Expand Down
2 changes: 1 addition & 1 deletion arcus/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.8' # pragma: no cover
__version__ = '1.2.9' # pragma: no cover
29 changes: 29 additions & 0 deletions tests/resources/cassettes/test_bill_payment_type_error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
interactions:
- request:
body: '{"biller_id": 13599, "account_number": "559999", "amount": 100.0, "currency":
"MXN", "name_on_account": null}'
headers:
Accept: [application/vnd.regalii.v1.6+json]
Accept-Encoding: ['gzip, deflate']
Authorization: ['APIAuth 88879c1b066dc9aea6201f27be2bbba9:5ZV1v+AlHt7SGRwJ+RFD0tYRQr8=']
Connection: [keep-alive]
Content-Length: ['109']
Content-MD5: [U86ULvlq1wG/DVe1HygOkw==]
Content-Type: [application/json]
Date: ['Wed, 25 Sep 2019 23:47:50 GMT']
User-Agent: [python-requests/2.21.0]
method: POST
uri: https://api.casiregalii.com/bill/pay
response:
body: {string: '{"code":"R19","message":"Payments with this biller are currently unavailable","mode":"STAGING"}'}
headers:
Cache-Control: [no-cache]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
Date: ['Wed, 25 Sep 2019 23:47:51 GMT']
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Transfer-Encoding: [chunked]
X-Request-Id: [7291a4fe-e4da-4133-9098-81dfb73df0e0]
X-Runtime: ['0.043308']
status: {code: 422, message: Unprocessable Entity}
version: 1
14 changes: 13 additions & 1 deletion tests/resources/test_bill_payments.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from arcus.exc import InvalidAccountNumber
from arcus.exc import InvalidAccountNumber, UnprocessableEntity
from arcus.resources import BillPayment


Expand Down Expand Up @@ -40,6 +40,18 @@ def test_bill_payment_invalid_phone_number(client):
assert exc.biller_id == biller_id


@pytest.mark.vcr
def test_bill_payment_type_error(client):
biller_id = 13599
account_number = '559999'
amount = 100.0
with pytest.raises(UnprocessableEntity) as excinfo:
client.bill_payments.create(biller_id, account_number, amount)
exc = excinfo.value
assert exc.account_number == account_number
assert exc.biller_id == biller_id


def test_bill_payment_list(client):
with pytest.raises(NotImplementedError):
client.bill_payments.list()
Expand Down

0 comments on commit 62fa724

Please sign in to comment.