X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Ftests%2Funit%2Futils.py;h=b2d5c605d5ebf79e034801b529015bcaaf02033b;hp=2f107a71eebb39debf542b7ad1f73824f7b54c0f;hb=HEAD;hpb=eb8943a887e2fb8cce0240382811f9e504f3c7fb diff --git a/n2vc/tests/unit/utils.py b/n2vc/tests/unit/utils.py index 2f107a7..807c892 100644 --- a/n2vc/tests/unit/utils.py +++ b/n2vc/tests/unit/utils.py @@ -123,13 +123,13 @@ class FakeManualMachine(MagicMock): 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): @@ -159,9 +159,15 @@ class FakeUnit(MagicMock): 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): @@ -170,12 +176,18 @@ class FakeApplication(AsyncMock): 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()]