Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OIE tests #146

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ options:
--okta-tile OKTA_TILE
Okta tile URL to use.
--okta-client-id OKTA_CLIENT_ID
Sets the Okta client ID used in OAuth2. If passed, the authorize code flow will run.
For OIE enabled Orgs this sets the Okta client ID to replace the value found by tokendito. It is used in the authorize code flow.
--okta-mfa OKTA_MFA Sets the MFA method
--okta-mfa-response OKTA_MFA_RESPONSE
Sets the MFA response to a challenge
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/test_http_client_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def test_post_request(client):
assert json_data["json"] == {"key": "value"}


def test_set_cookies(client):
def test_add_cookies(client):
"""Test the ability to set cookies using HTTPClient."""
# Set a test cookie for the client
client.set_cookies({"test_cookie": "cookie_value"})
client.add_cookies({"test_cookie": "cookie_value"})

# Make a request to the /cookies endpoint of httpbin which returns set cookies
response = client.get("https://httpbin.org/cookies")
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_bad_post_request(client, mocker):
def test_reset_session(client):
"""Test the reset method to ensure session is reset."""
# Set a test cookie for the client
client.set_cookies({"test_cookie": "cookie_value"})
client.add_cookies({"test_cookie": "cookie_value"})
# Reset the session
client.reset()

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def test_init(client):
assert str(expected_user_agent) in str(client.session.headers["User-Agent"])


def test_set_cookies(client):
def test_add_cookies(client):
"""Test setting cookies in the session."""
cookies = {"test_cookie": "cookie_value"}
client.set_cookies(cookies)
client.add_cookies(cookies)
# Check if the provided cookie is set correctly in the session
assert client.session.cookies.get_dict() == cookies

Expand Down Expand Up @@ -188,7 +188,7 @@ def test_get_device_token(client):
"""Test getting device token from the session."""
device_token = "test-device-token"
cookies = {"DT": device_token}
client.set_cookies(cookies)
client.add_cookies(cookies)

# Check if the device token is set correctly in the session
assert client.get_device_token() == device_token
Expand Down
Loading
Loading