Skip to content

Commit 1868e1e

Browse files
committed
Add test for lazy controller_name
1 parent a3a1c12 commit 1868e1e

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

tests/integration/test_controller.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import uuid
66
import hvac
77

8-
from juju import access
8+
from juju import access, controller
99
from juju.client.connection import Connection
1010
from juju.client import client
1111
from juju.errors import JujuAPIError, JujuError
@@ -298,6 +298,22 @@ async def test_grant_revoke_controller_access(event_loop):
298298
raise
299299

300300

301+
@base.bootstrapped
302+
async def test_connection_lazy_jujudata(event_loop):
303+
async with base.CleanController() as cont1:
304+
conn = cont1.connection()
305+
new_controller = controller.Controller()
306+
await new_controller.connect(endpoint=conn.endpoints[0][0],
307+
cacert=conn.cacert,
308+
username=conn.usertag,
309+
password=conn.password,
310+
)
311+
assert new_controller._controller_name is None
312+
new_controller.controller_name
313+
assert new_controller._controller_name is not None
314+
await new_controller.disconnect()
315+
316+
301317
@base.bootstrapped
302318
async def test_grant_revoke_model_access(event_loop):
303319
async with base.CleanController() as controller:

0 commit comments

Comments
 (0)