Skip to content

Commit 2f756e3

Browse files
author
Brett Chaldecott
committed
test: enhance login test setup with OpenID configuration mocks
1 parent d186298 commit 2f756e3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

testv2/testv2_expected_behavior/test_login.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,20 @@ def run_async(coro):
1111
return asyncio.run(coro)
1212

1313
class TestExpectedLogin(unittest.TestCase):
14-
def setUp(self):
14+
@patch('requests.get')
15+
def setUp(self, mock_get):
1516
"""Set up test fixtures."""
17+
# Mock the OpenID configuration response
18+
mock_response = MagicMock()
19+
mock_response.status_code = 200
20+
mock_response.json.return_value = {
21+
"authorization_endpoint": "https://example.com/oauth2/auth",
22+
"token_endpoint": "https://example.com/oauth2/token",
23+
"end_session_endpoint": "https://example.com/logout",
24+
"userinfo_endpoint": "https://example.com/oauth2/userinfo"
25+
}
26+
mock_get.return_value = mock_response
27+
1628
self.oauth = OAuth(
1729
client_id="test_client_id",
1830
client_secret="test_client_secret",

0 commit comments

Comments
 (0)