@@ -19,7 +19,7 @@ def test_smoke_test(self, mock_refresh_bidstream_keys): # SmokeTest
1919 with self .subTest (expected_scope = expected_scope , expected_version = expected_version ):
2020 token = generate_uid_token (expected_scope , expected_version )
2121 mock_refresh_bidstream_keys .return_value = create_key_collection (expected_scope )
22- self ._client .refresh_keys ()
22+ self ._client .refresh ()
2323 decrypted = self ._client .decrypt_token_into_raw_uid (token , None )
2424 self .assertEqual (decrypted .identity_scope , expected_scope )
2525 self .assertEqual (decrypted .advertising_token_version , expected_version )
@@ -31,12 +31,12 @@ def test_phone_uids(self, mock_refresh_bidstream_keys): # PhoneTest
3131 mock_refresh_bidstream_keys .return_value = EncryptionKeysCollection ([master_key , site_key ],
3232 expected_scope , site_id , 1 ,
3333 99999 , 86400 )
34- self ._client .refresh_keys ()
34+ self ._client .refresh ()
3535 token = generate_uid_token (expected_scope , expected_version , phone_uid )
3636 self .assertEqual (IdentityType .Phone , get_identity_type (token ))
3737 result = self ._client .decrypt_token_into_raw_uid (token , None )
3838 self .assertIsNotNone (result )
39- self .assertEqual (result .uid2 , phone_uid )
39+ self .assertEqual (result .uid , phone_uid )
4040 self .assertEqual (result .identity_scope , expected_scope )
4141 self .assertEqual (result .advertising_token_version , expected_version )
4242
@@ -50,7 +50,7 @@ def test_token_lifetime_too_long_for_bidstream(self, mock_refresh_bidstream_keys
5050 expected_scope , site_id , 1 ,
5151 99999 , 86400 ,
5252 max_bidstream_lifetime_seconds = max_bidstream_lifetime )
53- self ._client .refresh_keys ()
53+ self ._client .refresh ()
5454 with self .assertRaises (EncryptionError ) as context :
5555 self ._client .decrypt_token_into_raw_uid (token , None )
5656 self .assertEqual ('invalid token lifetime' , str (context .exception ))
@@ -63,7 +63,7 @@ def test_token_generated_in_the_future_to_simulate_clock_skew(self, mock_refresh
6363 mock_refresh_bidstream_keys .return_value = EncryptionKeysCollection ([master_key , site_key ],
6464 expected_scope , site_id , 1 ,
6565 99999 , 86400 )
66- self ._client .refresh_keys ()
66+ self ._client .refresh ()
6767 with self .assertRaises (EncryptionError ) as context :
6868 self ._client .decrypt_token_into_raw_uid (token , None )
6969 self .assertEqual ('invalid token lifetime' , str (context .exception ))
@@ -76,7 +76,7 @@ def test_token_generated_in_the_future_within_allowed_clock_skew(self, mock_refr
7676 mock_refresh_bidstream_keys .return_value = EncryptionKeysCollection ([master_key , site_key ],
7777 expected_scope , site_id , 1 ,
7878 99999 , 86400 )
79- self ._client .refresh_keys ()
79+ self ._client .refresh ()
8080 result = self ._client .decrypt_token_into_raw_uid (token , None )
8181 self .assertIsNotNone (result )
8282 self .assertEqual (result .identity_scope , expected_scope )
@@ -85,7 +85,7 @@ def test_token_generated_in_the_future_within_allowed_clock_skew(self, mock_refr
8585 def test_empty_keys (self , mock_refresh_bidstream_keys ): # EmptyKeyContainer
8686 token = generate_uid_token (IdentityScope .UID2 , AdvertisingTokenVersion .ADVERTISING_TOKEN_V3 )
8787 mock_refresh_bidstream_keys .return_value = None
88- self ._client .refresh_keys ()
88+ self ._client .refresh ()
8989 with self .assertRaises (EncryptionError ) as context :
9090 self ._client .decrypt_token_into_raw_uid (token , None )
9191 self .assertEqual ('keys not initialized' , str (context .exception ))
@@ -99,7 +99,7 @@ def get_post_refresh_keys_response_with_key_expired():
9999 return create_default_key_collection ([master_key_expired , site_key_expired ])
100100
101101 mock_refresh_bidstream_keys .return_value = get_post_refresh_keys_response_with_key_expired ()
102- self ._client .refresh_keys ()
102+ self ._client .refresh ()
103103
104104 with self .assertRaises (EncryptionError ) as context :
105105 self ._client .decrypt_token_into_raw_uid (example_uid , None )
@@ -113,7 +113,7 @@ def get_post_refresh_keys_response_with_key_expired():
113113 return create_default_key_collection ([another_master_key , another_site_key ])
114114
115115 mock_refresh_bidstream_keys .return_value = get_post_refresh_keys_response_with_key_expired ()
116- self ._client .refresh_keys ()
116+ self ._client .refresh ()
117117 token = generate_uid_token (IdentityScope .UID2 , AdvertisingTokenVersion .ADVERTISING_TOKEN_V4 )
118118
119119 with self .assertRaises (EncryptionError ) as context :
@@ -123,7 +123,7 @@ def get_post_refresh_keys_response_with_key_expired():
123123
124124 def test_invalid_payload (self , mock_refresh_bidstream_keys ): #InvalidPayload
125125 mock_refresh_bidstream_keys .return_value = create_default_key_collection ([master_key , site_key ])
126- self ._client .refresh_keys ()
126+ self ._client .refresh ()
127127 token = generate_uid_token (IdentityScope .UID2 , AdvertisingTokenVersion .ADVERTISING_TOKEN_V4 )
128128 payload = Uid2Base64UrlCoder .decode (token )
129129 bad_token = base64 .urlsafe_b64encode (payload [:0 ])
@@ -134,7 +134,7 @@ def test_invalid_payload(self, mock_refresh_bidstream_keys): #InvalidPayload
134134
135135 def test_token_expiry_custom_decryption_time (self , mock_refresh_bidstream_keys ):
136136 mock_refresh_bidstream_keys .return_value = create_default_key_collection ([master_key , site_key ])
137- self ._client .refresh_keys ()
137+ self ._client .refresh ()
138138
139139 expires_at = now - dt .timedelta (days = 60 )
140140 created_at = expires_at - dt .timedelta (minutes = 1 )
@@ -151,7 +151,7 @@ def test_token_expiry_custom_decryption_time(self, mock_refresh_bidstream_keys):
151151
152152 def test_refresh_keys (self , mock_refresh_bidstream_keys ):
153153 mock_refresh_bidstream_keys .return_value = create_default_key_collection ([master_key ])
154- self ._client .refresh_keys ()
154+ self ._client .refresh ()
155155 mock_refresh_bidstream_keys .assert_called_once_with (self ._CONST_BASE_URL , self ._CONST_API_KEY ,
156156 client_secret_bytes )
157157
0 commit comments