detailed_status: str,
vca_status: str,
entity_type: str,
+ vca_id: str = None,
):
+ """
+ Write application status to database
+
+ :param: db_dict: DB dictionary
+ :param: status: Status of the application
+ :param: detailed_status: Detailed status
+ :param: vca_status: VCA status
+ :param: entity_type: Entity type ("application", "machine, and "action")
+ :param: vca_id: Id of the VCA. If None, the default VCA will be used.
+ """
self.last_written_values = Dict(
{
"n2vc_status": status,
model_name = "FAKE MODEL"
entity_type = "machine"
safe_data = {"instance-id": "manual:myid"}
+ series = "FAKE SERIES"
async def destroy(self, force):
pass
class FakeWatcher(AsyncMock):
-
delta_to_return = None
async def Next(self):
async def is_leader_from_status(self):
return True
- async def run_action(self, action_name):
+ async def run_action(self, action_name, **kwargs):
return FakeAction()
+ @property
+ def machine_id(self):
+ return "existing_machine_id"
+
+ name = "existing_unit"
+
class FakeApplication(AsyncMock):
async def set_config(self, config):
async def add_unit(self, to):
pass
+ async def destroy_unit(self, unit_name):
+ pass
+
async def get_actions(self):
return ["existing_action"]
+ async def get_config(self):
+ return ["app_config"]
+
+ async def scale(self, scale):
+ pass
+
units = [FakeUnit(), FakeUnit()]