Feature 10509 manual scaling for native k8s charm
[osm/N2VC.git] / n2vc / tests / unit / utils.py
index ac86cdd..7e8907f 100644 (file)
@@ -82,7 +82,18 @@ class FakeN2VC(MagicMock):
         detailed_status: str,
         vca_status: str,
         entity_type: str,
         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,
         self.last_written_values = Dict(
             {
                 "n2vc_status": status,
@@ -148,7 +159,7 @@ class FakeUnit(MagicMock):
     async def is_leader_from_status(self):
         return True
 
     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()
 
 
         return FakeAction()
 
 
@@ -162,6 +173,12 @@ class FakeApplication(AsyncMock):
     async def get_actions(self):
         return ["existing_action"]
 
     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()]
 
 
     units = [FakeUnit(), FakeUnit()]