Skip to content

Commit

Permalink
integration/test_client: skip password auth if not supported by LXD
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
  • Loading branch information
simondeziel committed Jun 19, 2024
1 parent 97826f4 commit 11fcc68
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class TestClient(IntegrationTestCase):
"""Tests for `Client`."""

def test_authenticate(self):
if self.client.has_api_extension("explicit_trust_token"):
self.skipTest("Required LXD support for password authentication not available!")

client = pylxd.Client("https://127.0.0.1:8443/")

self.assertFalse(client.trusted)
Expand All @@ -30,6 +33,9 @@ def test_authenticate(self):
self.assertTrue(client.trusted)

def test_authenticate_with_project(self):
if self.client.has_api_extension("explicit_trust_token"):
self.skipTest("Required LXD support for password authentication not available!")

try:
client = pylxd.Client("https://127.0.0.1:8443/", project="test-project")
except exceptions.ClientConnectionFailed as e:
Expand Down

0 comments on commit 11fcc68

Please sign in to comment.