CharmHub and new kafka and zookeeper charms
[osm/devops.git] / installers / charm / lcm / tests / test_charm.py
index 3e6b2a4..aa11a74 100644 (file)
@@ -31,7 +31,7 @@ from ops.testing import Harness
 
 
 class TestCharm(unittest.TestCase):
-    """Prometheus Charm unit tests."""
+    """LCM Charm unit tests."""
 
     def setUp(self) -> NoReturn:
         """Test setup"""
@@ -109,32 +109,32 @@ class TestCharm(unittest.TestCase):
         # Verifying status
         self.assertIsInstance(self.harness.charm.unit.status, BlockedStatus)
 
-    def test_build_pod_spec(
-        self,
-    ) -> NoReturn:
-        expected_config = {
-            "OSMLCM_GLOBAL_LOGLEVEL": self.config["log_level"],
-            "OSMLCM_DATABASE_COMMONKEY": self.config["database_commonkey"],
-        }
-        expected_config.update(
-            {
-                f"OSMLCM_{k.upper()}": v
-                for k, v in self.config.items()
-                if k.startswith("vca_")
-            }
-        )
-        self.harness.charm._check_missing_dependencies = mock.Mock()
-        pod_spec = self.harness.charm.build_pod_spec(
-            {"imageDetails": {"imagePath": "lcm-image"}}
-        )
-        actual_config = pod_spec["containers"][0]["envConfig"]
-
-        self.assertDictContainsSubset(
-            expected_config,
-            actual_config,
-        )
-        for config_key in actual_config:
-            self.assertNotIn("VCA_MODEL_CONFIG", config_key)
+    def test_build_pod_spec(
+        self,
+    ) -> NoReturn:
+        expected_config = {
+            "OSMLCM_GLOBAL_LOGLEVEL": self.config["log_level"],
+            "OSMLCM_DATABASE_COMMONKEY": self.config["database_commonkey"],
+        }
+        expected_config.update(
+            {
+                f"OSMLCM_{k.upper()}": v
+                for k, v in self.config.items()
+                if k.startswith("vca_")
+            }
+        )
+        self.harness.charm._check_missing_dependencies = mock.Mock()
+        pod_spec = self.harness.charm.build_pod_spec(
+            {"imageDetails": {"imagePath": "lcm-image"}}
+        )
+        actual_config = pod_spec["containers"][0]["envConfig"]
+
+        self.assertDictContainsSubset(
+            expected_config,
+            actual_config,
+        )
+        for config_key in actual_config:
+            self.assertNotIn("VCA_MODEL_CONFIG", config_key)
 
     def test_build_pod_spec_with_model_config(
         self,
@@ -217,7 +217,7 @@ class TestCharm(unittest.TestCase):
         kafka_relation_id = self.harness.add_relation("kafka", "kafka")
         self.harness.add_relation_unit(kafka_relation_id, "kafka/0")
         self.harness.update_relation_data(
-            kafka_relation_id, "kafka/0", {"host": "kafka", "port": 9092}
+            kafka_relation_id, "kafka", {"host": "kafka", "port": 9092}
         )
 
     def initialize_mongo_config(self):