Skip to content

Commit 62fa724

Browse files
authored
Fix typo in arcus_error (#152)
* fix typo error * Update version.py
1 parent c45f8e3 commit 62fa724

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

arcus/exc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def __init__(self, **kwargs):
248248
R16=FailedConsult,
249249
R17=InvalidAmount,
250250
R18=LimitExceeded,
251-
R19=InvalidBiller,
251+
R19=UnprocessableEntity,
252252
R20=InvalidBiller,
253253
R21=InvalidBiller,
254254
R22=BillerMaintenance,

arcus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.2.8' # pragma: no cover
1+
__version__ = '1.2.9' # pragma: no cover
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
interactions:
2+
- request:
3+
body: '{"biller_id": 13599, "account_number": "559999", "amount": 100.0, "currency":
4+
"MXN", "name_on_account": null}'
5+
headers:
6+
Accept: [application/vnd.regalii.v1.6+json]
7+
Accept-Encoding: ['gzip, deflate']
8+
Authorization: ['APIAuth 88879c1b066dc9aea6201f27be2bbba9:5ZV1v+AlHt7SGRwJ+RFD0tYRQr8=']
9+
Connection: [keep-alive]
10+
Content-Length: ['109']
11+
Content-MD5: [U86ULvlq1wG/DVe1HygOkw==]
12+
Content-Type: [application/json]
13+
Date: ['Wed, 25 Sep 2019 23:47:50 GMT']
14+
User-Agent: [python-requests/2.21.0]
15+
method: POST
16+
uri: https://api.casiregalii.com/bill/pay
17+
response:
18+
body: {string: '{"code":"R19","message":"Payments with this biller are currently unavailable","mode":"STAGING"}'}
19+
headers:
20+
Cache-Control: [no-cache]
21+
Connection: [keep-alive]
22+
Content-Type: [application/json; charset=utf-8]
23+
Date: ['Wed, 25 Sep 2019 23:47:51 GMT']
24+
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
25+
Transfer-Encoding: [chunked]
26+
X-Request-Id: [7291a4fe-e4da-4133-9098-81dfb73df0e0]
27+
X-Runtime: ['0.043308']
28+
status: {code: 422, message: Unprocessable Entity}
29+
version: 1

tests/resources/test_bill_payments.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from arcus.exc import InvalidAccountNumber
3+
from arcus.exc import InvalidAccountNumber, UnprocessableEntity
44
from arcus.resources import BillPayment
55

66

@@ -40,6 +40,18 @@ def test_bill_payment_invalid_phone_number(client):
4040
assert exc.biller_id == biller_id
4141

4242

43+
@pytest.mark.vcr
44+
def test_bill_payment_type_error(client):
45+
biller_id = 13599
46+
account_number = '559999'
47+
amount = 100.0
48+
with pytest.raises(UnprocessableEntity) as excinfo:
49+
client.bill_payments.create(biller_id, account_number, amount)
50+
exc = excinfo.value
51+
assert exc.account_number == account_number
52+
assert exc.biller_id == biller_id
53+
54+
4355
def test_bill_payment_list(client):
4456
with pytest.raises(NotImplementedError):
4557
client.bill_payments.list()

0 commit comments

Comments
 (0)