Feature-9904: Enhancing NG-UI to enable Juju operational view dashboard
[osm/N2VC.git] / n2vc / tests / unit / test_libjuju.py
index b7c7901..ad0933c 100644 (file)
@@ -24,7 +24,6 @@ from .utils import FakeN2VC, FakeMachine, FakeApplication
 from n2vc.libjuju import Libjuju
 from n2vc.exceptions import (
     JujuControllerFailedConnecting,
-    JujuModelAlreadyExists,
     JujuMachineNotFound,
     JujuApplicationNotFound,
     JujuActionNotFound,
@@ -67,8 +66,6 @@ class LibjujuTestCase(asynctest.TestCase):
             log=None,
             db={"get_one": []},
             n2vc=n2vc,
-            apt_mirror="192.168.0.100",
-            enable_os_upgrade=True,
         )
         logging.disable(logging.CRITICAL)
         loop.run_until_complete(self.libjuju.disconnect())
@@ -106,8 +103,6 @@ class LibjujuInitTestCase(asynctest.TestCase):
             log=None,
             db={"get_one": []},
             n2vc=self.n2vc,
-            apt_mirror="192.168.0.100",
-            enable_os_upgrade=True,
         )
         mock_update_endpoints.assert_called_once_with([self.endpoint])
         mock__get_api_endpoints_db.assert_called_once()
@@ -129,8 +124,6 @@ class LibjujuInitTestCase(asynctest.TestCase):
             log=None,
             db={"get_one": []},
             n2vc=self.n2vc,
-            apt_mirror="192.168.0.100",
-            enable_os_upgrade=True,
         )
         mock_update_endpoints.assert_not_called()
         mock__get_api_endpoints_db.assert_called_once()
@@ -152,8 +145,6 @@ class LibjujuInitTestCase(asynctest.TestCase):
             log=None,
             db={"get_one": []},
             n2vc=self.n2vc,
-            apt_mirror="192.168.0.100",
-            enable_os_upgrade=True,
         )
         mock_update_endpoints.assert_called_once_with([self.endpoint])
         mock__get_api_endpoints_db.assert_called_once()
@@ -238,10 +229,10 @@ class AddModelTest(LibjujuTestCase):
     ):
         mock_model_exists.return_value = True
 
-        with self.assertRaises(JujuModelAlreadyExists):
-            self.loop.run_until_complete(
-                self.libjuju.add_model("existing_model", "cloud")
-            )
+        # This should not raise an exception
+        self.loop.run_until_complete(
+            self.libjuju.add_model("existing_model", "cloud")
+        )
 
         mock_disconnect_controller.assert_called()