@@ -99,29 +99,29 @@ def test_load_config(self):
99
99
self .assertEqual (cert_filename , loader .ssl_ca_cert )
100
100
self .assertEqual ('Bearer ' + _TEST_TOKEN , loader .token )
101
101
102
- def test_refresh_token (self ):
102
+ async def test_refresh_token (self ):
103
103
loader = self .get_test_loader ()
104
104
config = Configuration ()
105
105
loader .load_and_set (config )
106
106
107
107
self .assertEqual ('Bearer ' + _TEST_TOKEN ,
108
- config .get_api_key_with_prefix ('BearerToken' ))
108
+ await config .get_api_key_with_prefix ('BearerToken' ))
109
109
self .assertEqual ('Bearer ' + _TEST_TOKEN , loader .token )
110
110
self .assertIsNotNone (loader .token_expires_at )
111
111
112
112
old_token_expires_at = loader .token_expires_at
113
113
loader ._token_filename = self ._create_file_with_temp_content (
114
114
_TEST_NEW_TOKEN )
115
115
self .assertEqual ('Bearer ' + _TEST_TOKEN ,
116
- config .get_api_key_with_prefix ('BearerToken' ))
116
+ await config .get_api_key_with_prefix ('BearerToken' ))
117
117
118
118
loader .token_expires_at = datetime .datetime .now ()
119
119
self .assertEqual ('Bearer ' + _TEST_NEW_TOKEN ,
120
- config .get_api_key_with_prefix ('BearerToken' ))
120
+ await config .get_api_key_with_prefix ('BearerToken' ))
121
121
self .assertEqual ('Bearer ' + _TEST_NEW_TOKEN , loader .token )
122
122
self .assertGreater (loader .token_expires_at , old_token_expires_at )
123
123
124
- def test_refresh_token_default_config_with_copies (self ):
124
+ async def test_refresh_token_default_config_with_copies (self ):
125
125
loader = self .get_test_loader ()
126
126
loader .load_and_set ()
127
127
@@ -132,7 +132,7 @@ def test_refresh_token_default_config_with_copies(self):
132
132
133
133
for config in configs :
134
134
self .assertEqual ('Bearer ' + _TEST_TOKEN ,
135
- config .get_api_key_with_prefix ('BearerToken' ))
135
+ await config .get_api_key_with_prefix ('BearerToken' ))
136
136
self .assertEqual ('Bearer ' + _TEST_TOKEN , loader .token )
137
137
self .assertIsNotNone (loader .token_expires_at )
138
138
@@ -142,13 +142,13 @@ def test_refresh_token_default_config_with_copies(self):
142
142
143
143
for config in configs :
144
144
self .assertEqual ('Bearer ' + _TEST_TOKEN ,
145
- config .get_api_key_with_prefix ('BearerToken' ))
145
+ await config .get_api_key_with_prefix ('BearerToken' ))
146
146
147
147
loader .token_expires_at = datetime .datetime .now ()
148
148
149
149
for config in configs :
150
150
self .assertEqual ('Bearer ' + _TEST_NEW_TOKEN ,
151
- config .get_api_key_with_prefix ('BearerToken' ))
151
+ await config .get_api_key_with_prefix ('BearerToken' ))
152
152
153
153
self .assertEqual ('Bearer ' + _TEST_NEW_TOKEN , loader .token )
154
154
self .assertGreater (loader .token_expires_at , old_token_expires_at )
0 commit comments