Skip to content

Commit c1923dd

Browse files
committed
Update exception messages in OAuth and TOTP tests for clarity and consistency
1 parent 808db4e commit c1923dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/unit/test_oauth_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_handle_redirect_no_code(self):
160160
with self.assertRaises(ValueError) as context:
161161
self.oauth_handler_with_secret.handle_redirect(redirect_url)
162162

163-
self.assertIn("Authorization code not found", str(context.exception))
163+
self.assertIn("Authorization code was not found in the redirect URL", str(context.exception))
164164

165165
def test_exchange_code_for_token_success(self):
166166
"""Test successful code exchange for token."""
@@ -242,7 +242,7 @@ def test_refresh_access_token_no_refresh_token(self):
242242
with self.assertRaises(ValueError) as context:
243243
self.oauth_handler_with_secret.refresh_access_token()
244244

245-
self.assertIn("No refresh token available", str(context.exception))
245+
self.assertIn("Refresh token is not available", str(context.exception))
246246

247247
def test_refresh_access_token_failure(self):
248248
"""Test refresh access token failure."""
@@ -305,7 +305,7 @@ def test_get_valid_access_token_no_refresh_token(self):
305305
with self.assertRaises(ValueError) as context:
306306
self.oauth_handler_with_secret.get_valid_access_token()
307307

308-
self.assertIn("No refresh token available", str(context.exception))
308+
self.assertIn("Refresh token is not available", str(context.exception))
309309

310310
def test_logout_success(self):
311311
"""Test successful logout."""

tests/unit/user_session/test_user_session_totp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_login_parameter_validation(self):
116116
# Test with empty email
117117
with self.assertRaises(PermissionError) as context:
118118
self.user_session.login("", self.test_password, self.test_tfa_token)
119-
self.assertIn("Email Id is required", str(context.exception))
119+
self.assertIn("Email ID is required", str(context.exception))
120120

121121
# Test with empty password
122122
with self.assertRaises(PermissionError) as context:

0 commit comments

Comments
 (0)