@@ -1025,20 +1025,21 @@ def test_4_4_speculative_authentication_should_be_ignored_on_reauthentication(se
1025
1025
listener = EventListener ()
1026
1026
client = self .create_client (event_listeners = [listener ])
1027
1027
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.
1029
1029
client2 = self .create_client ()
1030
1030
client2 .test .test .find_one ()
1031
1031
client .options .pool_options ._credentials .cache .data = (
1032
1032
client2 .options .pool_options ._credentials .cache .data
1033
1033
)
1034
1034
client2 .close ()
1035
+ client2 .options .pool_options ._credentials .cache .data .access_token = "bad"
1035
1036
self .request_called = 0
1036
1037
1037
1038
# Perform an `insert` operation that succeeds.
1038
1039
client .test .test .insert_one ({})
1039
1040
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 )
1042
1043
1043
1044
# Assert there were no `SaslStart` commands executed.
1044
1045
for event in listener .started_events :
@@ -1055,8 +1056,8 @@ def test_4_4_speculative_authentication_should_be_ignored_on_reauthentication(se
1055
1056
# Perform an `insert` operation that succeeds.
1056
1057
client .test .test .insert_one ({})
1057
1058
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 )
1060
1061
1061
1062
# Assert there were `SaslStart` commands executed.
1062
1063
found = False
0 commit comments