File tree 1 file changed +6
-10
lines changed
test/test-manager/src/tests
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -278,9 +278,8 @@ pub async fn clear_devices(device_client: &DevicesProxy) -> anyhow::Result<()> {
278
278
}
279
279
280
280
pub async fn new_device_client ( ) -> anyhow:: Result < DevicesProxy > {
281
- use mullvad_api:: { proxy:: ApiConnectionMode , ApiEndpoint , API } ;
281
+ use mullvad_api:: { proxy:: ApiConnectionMode , ApiEndpoint } ;
282
282
283
- let api_endpoint = ApiEndpoint :: from_env_vars ( ) ;
284
283
let api_host = format ! ( "api.{}" , TEST_CONFIG . mullvad_host) ;
285
284
286
285
let api_host_with_port = format ! ( "{api_host}:443" ) ;
@@ -289,14 +288,11 @@ pub async fn new_device_client() -> anyhow::Result<DevicesProxy> {
289
288
. context ( "failed to resolve API host" ) ?;
290
289
291
290
// Override the API endpoint to use the one specified in the test config
292
- let _ = API . override_init ( ApiEndpoint {
293
- host : Some ( api_host) ,
294
- address : Some ( api_address) ,
295
- ..api_endpoint
296
- } ) ;
297
-
298
- let api = mullvad_api:: Runtime :: new ( tokio:: runtime:: Handle :: current ( ) )
299
- . expect ( "failed to create api runtime" ) ;
291
+ let endpoint = ApiEndpoint :: new ( api_host, api_address, false ) ;
292
+
293
+ let api =
294
+ mullvad_api:: Runtime :: with_custom_endpoint ( tokio:: runtime:: Handle :: current ( ) , & endpoint) ;
295
+
300
296
let rest_handle = api. mullvad_rest_handle ( ApiConnectionMode :: Direct . into_provider ( ) ) ;
301
297
Ok ( DevicesProxy :: new ( rest_handle) )
302
298
}
You can’t perform that action at this time.
0 commit comments