187dcb01cac4394723da9dc10a63a9456cf15ed8
7 from juju
.client
.connection
import Connection
10 def is_bootstrapped():
11 result
= subprocess
.run(['juju', 'switch'], stdout
=subprocess
.PIPE
)
14 result
.returncode
== 0 and
15 len(result
.stdout
.decode().strip()) > 0)
17 bootstrapped
= pytest
.mark
.skipif(
18 not is_bootstrapped(),
19 reason
='bootstrapped Juju environment required')
23 class FunctionalConnectionTest(unittest
.TestCase
):
24 def test_connect_current(self
):
25 loop
= asyncio
.get_event_loop()
26 conn
= loop
.run_until_complete(
27 Connection
.connect_current())
29 self
.assertIsInstance(conn
, Connection
)