Skip to content

Commit

Permalink
add more test
Browse files Browse the repository at this point in the history
  • Loading branch information
sevignyj committed Dec 18, 2023
1 parent 1d4490a commit 3bd9a5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/test_okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ def test_get_authorize_code():
response.url = "https://example.com?code=pytest"
assert okta.get_authorize_code(response, "sessionToken") == "pytest"

response.url = "https//example.com?error=login_required"
assert okta.get_authorize_code(response, None) is None


def test_authorization_code_enabled():
"""Test authorization_code_enabled."""
Expand Down Expand Up @@ -701,6 +704,10 @@ def test_get_nonce(mocker):

assert okta.get_nonce("https://acme.com") == "PYTEST_NONCE"

response.text = "nonce-non-present"
mocker.patch.object(HTTP_client, "get", return_value=response)
assert okta.get_nonce("https://acme.com") is None


def test_get_oauth2_session_data(mocker):
"""Test get_oauth2_session_data."""
Expand Down
1 change: 1 addition & 0 deletions tokendito/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def cmd_interface(args):
sys.exit(1)

config.okta["org"] = config.okta["org"].strip("/") # rm trailing / if provided as such
# so the urls with this as base dont have //
if config.user["use_device_token"]:
device_token = config.okta["device_token"]
if device_token:
Expand Down

0 comments on commit 3bd9a5a

Please sign in to comment.