Corrected bugs on support for helm v3
[osm/N2VC.git] / n2vc / tests / unit / test_k8s_helm3_conn.py
index e5af881..65af0b7 100644 (file)
@@ -135,6 +135,8 @@ class TestK8sHelm3Conn(asynctest.TestCase):
         self.helm_conn._status_kdu = asynctest.CoroutineMock(return_value=None)
         self.helm_conn._store_status = asynctest.CoroutineMock()
         self.helm_conn._generate_release_name = Mock(return_value="stable-openldap-0005399828")
+        self.helm_conn._get_namespaces = asynctest.CoroutineMock(return_value=[])
+        self.helm_conn._create_namespace = asynctest.CoroutineMock()
 
         kdu_instance = await self.helm_conn.install(self.cluster_uuid,
                                                     kdu_model,
@@ -142,6 +144,8 @@ class TestK8sHelm3Conn(asynctest.TestCase):
                                                     namespace=self.namespace,
                                                     db_dict=db_dict)
 
+        self.helm_conn._get_namespaces.assert_called_once()
+        self.helm_conn._create_namespace.assert_called_once_with(self.cluster_id, self.namespace)
         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._generate_release_name.assert_called_once_with("stable/openldap")