Skip to content

Commit

Permalink
Test Uber APIError handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jshcodes committed Sep 1, 2023
1 parent 112b3fc commit 72a2e09
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/test_uber_api_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# flake8: noqa=E402
# pylint: disable=C0103
# Classes to test - manually imported from our sibling folder
from falconpy import APIHarness
from falconpy import APIHarness, APIError
# Import perform_request from _util so we can test generating 405's directly
from falconpy._util import perform_request, force_default

Expand Down Expand Up @@ -354,8 +354,7 @@ def test_uber_deprecated_attributes(self):

def test_uber_properties(self):
# Force a new object so we can flip the debug flag
temp_falcon = APIHarness(client_id=config["falcon_client_id"],
client_secret=config["falcon_client_secret"],
temp_falcon = APIHarness(access_token=falcon.token_value,
base_url=config["falcon_base_url"],
debug=True
)
Expand All @@ -369,3 +368,16 @@ def test_uber_revoke_success(self):
assert(bool(
falcon.command("oauth2RevokeToken", token_value=falcon.token_value)["status_code"]==200
))

def test_pythonic_failure(self):
_success = False
new_falcon = APIHarness(access_token=falcon.token_value,
base_url=config["falcon_base_url"],
debug=_DEBUG,
pythonic=True
)
try:
new_falcon.command("GetDeviceDetails", ids="12345678")
except APIError:
_success = True
assert _success

0 comments on commit 72a2e09

Please sign in to comment.