Ensure async calls are performed
[osm/N2VC.git] / n2vc / tests / unit / test_k8s_helm_conn.py
index 907ff40..5112363 100644 (file)
@@ -160,9 +160,17 @@ class TestK8sHelmConn(asynctest.TestCase):
             db_dict=db_dict,
         )
 
-        self.helm_conn.fs.sync.assert_called_once_with(from_path=self.cluster_id)
-        self.helm_conn.fs.reverse_sync.assert_called_once_with(
-            from_path=self.cluster_id
+        self.helm_conn.fs.sync.assert_has_calls(
+            [
+                asynctest.call(from_path=self.cluster_id),
+                asynctest.call(from_path=self.cluster_id),
+            ]
+        )
+        self.helm_conn.fs.reverse_sync.assert_has_calls(
+            [
+                asynctest.call(from_path=self.cluster_id),
+                asynctest.call(from_path=self.cluster_id),
+            ]
         )
         self.helm_conn._store_status.assert_called_with(
             cluster_id=self.cluster_id,
@@ -177,7 +185,7 @@ class TestK8sHelmConn(asynctest.TestCase):
             "--name=stable-openldap-0005399828 --namespace testk8s stable/openldap "
             "--version 1.2.2"
         )
-        self.helm_conn._local_async_exec.assert_called_once_with(
+        self.helm_conn._local_async_exec.assert_called_with(
             command=command, env=self.env, raise_exception_on_error=False
         )
 
@@ -203,8 +211,11 @@ class TestK8sHelmConn(asynctest.TestCase):
             self.cluster_uuid, kdu_instance, kdu_model, atomic=True, db_dict=db_dict
         )
         self.helm_conn.fs.sync.assert_called_with(from_path=self.cluster_id)
-        self.helm_conn.fs.reverse_sync.assert_called_once_with(
-            from_path=self.cluster_id
+        self.helm_conn.fs.reverse_sync.assert_has_calls(
+            [
+                asynctest.call(from_path=self.cluster_id),
+                asynctest.call(from_path=self.cluster_id),
+            ]
         )
         self.helm_conn._store_status.assert_called_with(
             cluster_id=self.cluster_id,
@@ -217,7 +228,7 @@ class TestK8sHelmConn(asynctest.TestCase):
             "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm upgrade "
             "--atomic --output yaml  --timeout 300 stable-openldap-0005399828 stable/openldap --version 1.2.3"
         )
-        self.helm_conn._local_async_exec.assert_called_once_with(
+        self.helm_conn._local_async_exec.assert_called_with(
             command=command, env=self.env, raise_exception_on_error=False
         )