Skip to content

Commit 24f047d

Browse files
committed
refactor
1 parent 9e4814d commit 24f047d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/auth_oidc/test_auth_oidc.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,20 +1025,21 @@ def test_4_4_speculative_authentication_should_be_ignored_on_reauthentication(se
10251025
listener = EventListener()
10261026
client = self.create_client(event_listeners=[listener])
10271027

1028-
# Preload the *Client Cache* with a valid access token to enforce Speculative Authentication.
1028+
# Poison the *Client Cache* with a valid access token to enforce Speculative Authentication.
10291029
client2 = self.create_client()
10301030
client2.test.test.find_one()
10311031
client.options.pool_options._credentials.cache.data = (
10321032
client2.options.pool_options._credentials.cache.data
10331033
)
10341034
client2.close()
1035+
client2.options.pool_options._credentials.cache.data.access_token = "bad"
10351036
self.request_called = 0
10361037

10371038
# Perform an `insert` operation that succeeds.
10381039
client.test.test.insert_one({})
10391040

1040-
# Assert that the callback was not called.
1041-
self.assertEqual(self.request_called, 0)
1041+
# Assert that the callback was called.
1042+
self.assertEqual(self.request_called, 1)
10421043

10431044
# Assert there were no `SaslStart` commands executed.
10441045
for event in listener.started_events:
@@ -1055,8 +1056,8 @@ def test_4_4_speculative_authentication_should_be_ignored_on_reauthentication(se
10551056
# Perform an `insert` operation that succeeds.
10561057
client.test.test.insert_one({})
10571058

1058-
# Assert that the callback was called once.
1059-
self.assertEqual(self.request_called, 1)
1059+
# Assert that the callback was called twice.
1060+
self.assertEqual(self.request_called, 2)
10601061

10611062
# Assert there were `SaslStart` commands executed.
10621063
found = False

0 commit comments

Comments
 (0)