Skip to content

Commit

Permalink
Corrected pre-commit issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Sep 30, 2023
1 parent 4daeec7 commit cc311d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_unauthorized_expired_text(self, r_get):
r_get.return_value = Mock(
status_code=401,
text="oauth_problem=token_expired&oauth_problem_advice=The%20access%20token%20has%20expired",
headers=head
headers=head,
)

credentials = Mock(base_url="")
Expand All @@ -203,7 +203,7 @@ def test_unauthorized_expired_text(self, r_get):
)
except Exception as e:
self.fail("Should raise a XeroUnauthorized, not %s" % e)

@patch("requests.get")
def test_unauthorized_expired_json(self, r_get):
"A session with an expired token raises an unauthorized exception"
Expand All @@ -213,7 +213,7 @@ def test_unauthorized_expired_json(self, r_get):
r_get.return_value = Mock(
status_code=401,
text='{"Type":null,"Title":"Unauthorized","Status":401,"Detail":"TokenExpired: token expired at 01/01/2001 00:00:00"}',
headers=head
headers=head,
)

credentials = Mock(base_url="")
Expand All @@ -225,7 +225,9 @@ def test_unauthorized_expired_json(self, r_get):

except XeroUnauthorized as e:
# Error messages have been extracted
self.assertEqual(str(e), "TokenExpired: token expired at 01/01/2001 00:00:00")
self.assertEqual(
str(e), "TokenExpired: token expired at 01/01/2001 00:00:00"
)
self.assertEqual(e.errors[0], "TokenExpired")

# The response has also been stored
Expand Down

0 comments on commit cc311d1

Please sign in to comment.