summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorEmīls <emils@mullvad.net>2024-12-09 10:59:51 +0100
committerEmīls <emils@mullvad.net>2025-01-02 10:29:05 +0100
commit3093408a057020fcd912976b892fbb6bc26e6293 (patch)
tree56ac01255fdc7f0c29aa6a8c5a8cdd863ff4f496 /test
parent58efb1004f8ca762fe6aa95f541c6dc329ed790e (diff)
downloadmullvadvpn-3093408a057020fcd912976b892fbb6bc26e6293.tar.xz
mullvadvpn-3093408a057020fcd912976b892fbb6bc26e6293.zip
Remove global API endpoint
Diffstat (limited to 'test')
-rw-r--r--test/test-manager/src/tests/account.rs13
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))
}