From 0e98777635656b97a84baa4f0f70c924687b28ed Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 9 Sep 2024 16:50:24 -0400 Subject: [PATCH] integration/test_client: update test for secret/password with cert Signed-off-by: Simon Deziel --- integration/test_client.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/integration/test_client.py b/integration/test_client.py index e0de35cf..8d29e62c 100644 --- a/integration/test_client.py +++ b/integration/test_client.py @@ -25,14 +25,13 @@ class TestClient(IntegrationTestCase): def test_authenticate(self): client = pylxd.Client("https://127.0.0.1:8443/") + self.assertFalse(client.trusted) + if client.has_api_extension("explicit_trust_token"): secret = os.getenv("LXD_TOKEN") + client.authenticate(secret=secret) else: - secret = "password" - - self.assertFalse(client.trusted) - - client.authenticate(secret) + client.authenticate(password="password") self.assertTrue(client.trusted) @@ -52,8 +51,8 @@ def test_authenticate_with_project(self): if client.has_api_extension("explicit_trust_token"): secret = os.getenv("LXD_TOKEN") + client.authenticate(secret=secret) else: - secret = "password" + client.authenticate(password="password") - client.authenticate(secret) self.assertEqual(client.host_info["environment"]["project"], "test-project")