67dfb2e3ca4d1b816c22a400267c2d0708bfdfcb
3 from juju
.client
.connection
import Connection
4 from juju
.client
import client
10 async def test_connect_current(event_loop
):
11 async with base
.CleanModel():
12 conn
= await Connection
.connect_current()
14 assert isinstance(conn
, Connection
)
20 async def test_monitor(event_loop
):
22 async with base
.CleanModel():
23 conn
= await Connection
.connect_current()
25 assert conn
.monitor
.status
== 'connected'
28 assert conn
.monitor
.status
== 'disconnected'
33 async def test_monitor_catches_error(event_loop
):
35 async with base
.CleanModel():
36 conn
= await Connection
.connect_current()
38 assert conn
.monitor
.status
== 'connected'
41 assert conn
.monitor
.status
== 'error'
48 async def test_full_status(event_loop
):
49 async with base
.CleanModel() as model
:
50 app
= await model
.deploy(
52 application_name
='ubuntu',
57 c
= client
.ClientFacade
.from_connection(model
.connection
)
59 status
= await c
.FullStatus(None)