Skip to content

Commit

Permalink
Fix __str__ of ResponseError
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Nov 29, 2017
1 parent 85283c4 commit ce98487
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions itunesiap/exceptions.py
Expand Up @@ -30,6 +30,7 @@ class InvalidReceipt(RequestError, Response):

def __init__(self, response_data):
Response.__init__(self, response_data)
RequestError.__init__(self, response_data)

@property
def description(self):
Expand Down
6 changes: 6 additions & 0 deletions tests/itunesiap_test.py
Expand Up @@ -106,6 +106,12 @@ def test_invalid_receipt():
with pytest.raises(itunesiap.exc.InvalidReceipt):
request.verify(env=itunesiap.env.sandbox)

try:
itunesiap.verify('bad data')
except itunesiap.exc.InvalidReceipt as e:
print(e) # __str__ test
print(repr(e)) # __repr__ test


def test_timeout():
with pytest.raises(itunesiap.exceptions.ItunesServerNotReachable):
Expand Down

0 comments on commit ce98487

Please sign in to comment.