diff options
| author | Emīls <emils@mullvad.net> | 2024-12-09 10:59:51 +0100 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2025-01-02 10:29:05 +0100 |
| commit | 3093408a057020fcd912976b892fbb6bc26e6293 (patch) | |
| tree | 56ac01255fdc7f0c29aa6a8c5a8cdd863ff4f496 /test | |
| parent | 58efb1004f8ca762fe6aa95f541c6dc329ed790e (diff) | |
| download | mullvadvpn-3093408a057020fcd912976b892fbb6bc26e6293.tar.xz mullvadvpn-3093408a057020fcd912976b892fbb6bc26e6293.zip | |
Remove global API endpoint
Diffstat (limited to 'test')
| -rw-r--r-- | test/test-manager/src/tests/account.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/test/test-manager/src/tests/account.rs b/test/test-manager/src/tests/account.rs index 7fe14ae58e..29227cc82b 100644 --- a/test/test-manager/src/tests/account.rs +++ b/test/test-manager/src/tests/account.rs @@ -278,9 +278,8 @@ pub async fn clear_devices(device_client: &DevicesProxy) -> anyhow::Result<()> { } pub async fn new_device_client() -> anyhow::Result<DevicesProxy> { - use mullvad_api::{proxy::ApiConnectionMode, ApiEndpoint, API}; + use mullvad_api::{proxy::ApiConnectionMode, ApiEndpoint}; - let api_endpoint = ApiEndpoint::from_env_vars(); let api_host = format!("api.{}", TEST_CONFIG.mullvad_host); let api_host_with_port = format!("{api_host}:443"); @@ -289,14 +288,10 @@ pub async fn new_device_client() -> anyhow::Result<DevicesProxy> { .context("failed to resolve API host")?; // Override the API endpoint to use the one specified in the test config - let _ = API.override_init(ApiEndpoint { - host: Some(api_host), - address: Some(api_address), - ..api_endpoint - }); + let endpoint = ApiEndpoint::new(api_host, api_address, false); + + let api = mullvad_api::Runtime::new(tokio::runtime::Handle::current(), &endpoint); - let api = mullvad_api::Runtime::new(tokio::runtime::Handle::current()) - .expect("failed to create api runtime"); let rest_handle = api.mullvad_rest_handle(ApiConnectionMode::Direct.into_provider()); Ok(DevicesProxy::new(rest_handle)) } |
