from n2vc.libjuju import Libjuju
from n2vc.exceptions import (
JujuControllerFailedConnecting,
- JujuModelAlreadyExists,
JujuMachineNotFound,
JujuApplicationNotFound,
JujuActionNotFound,
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())
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()
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()
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()
):
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()