@@ -303,13 +303,19 @@ def test_gateway_cli_options(jp_configurable_serverapp, capsys):
303
303
GatewayClient .clear_instance ()
304
304
305
305
306
- @pytest .mark .parametrize ("renewer_type" , ["default" , "custom" ])
307
- def test_token_renewer_config (jp_server_config , jp_configurable_serverapp , renewer_type ):
306
+ @pytest .mark .parametrize (
307
+ "renewer_type,initial_auth_token" , [("default" , "" ), ("custom" , None ), ("custom" , "" )]
308
+ )
309
+ def test_token_renewer_config (
310
+ jp_server_config , jp_configurable_serverapp , renewer_type , initial_auth_token
311
+ ):
308
312
argv = ["--gateway-url=" + mock_gateway_url ]
309
313
if renewer_type == "custom" :
310
314
argv .append (
311
315
"--GatewayClient.gateway_token_renewer_class=tests.test_gateway.CustomTestTokenRenewer"
312
316
)
317
+ if initial_auth_token is None :
318
+ argv .append ("--GatewayClient.auth_token=None" )
313
319
314
320
GatewayClient .clear_instance ()
315
321
app = jp_configurable_serverapp (argv = argv )
@@ -331,6 +337,11 @@ def test_token_renewer_config(jp_server_config, jp_configurable_serverapp, renew
331
337
gw_client .auth_header_key , gw_client .auth_scheme , gw_client .auth_token or ""
332
338
)
333
339
assert token == CustomTestTokenRenewer .TEST_EXPECTED_TOKEN_VALUE
340
+ gw_client .load_connection_args ()
341
+ if renewer_type == "default" or initial_auth_token is None :
342
+ assert gw_client .auth_token == initial_auth_token
343
+ else :
344
+ assert gw_client .auth_token == CustomTestTokenRenewer .TEST_EXPECTED_TOKEN_VALUE
334
345
335
346
336
347
@pytest .mark .parametrize (
0 commit comments