Update add_machine example in docs.
[osm/N2VC.git] / tests / client / test_connection.py
index 18b5863..9c61759 100644 (file)
@@ -1,15 +1,14 @@
-import asyncio
-import unittest
+import pytest
 
 from juju.client.connection import Connection
-from ..base import bootstrapped
+from .. import base
 
 
-@bootstrapped
-class FunctionalConnectionTest(unittest.TestCase):
-    def test_connect_current(self):
-        loop = asyncio.get_event_loop()
-        conn = loop.run_until_complete(
-            Connection.connect_current())
+@base.bootstrapped
+@pytest.mark.asyncio
+async def test_connect_current(event_loop):
+    async with base.CleanModel():
+        conn = await Connection.connect_current()
 
-        self.assertIsInstance(conn, Connection)
+        assert isinstance(conn, Connection)
+        await conn.close()