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 d8852d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ 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 +35,11 @@ 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 d8852d3

Please sign in to comment.