Skip to content

Commit

Permalink
integration/test_client: update test for secret/password with cert
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Sep 9, 2024
1 parent a1ac877 commit 0e98777
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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")

0 comments on commit 0e98777

Please sign in to comment.