Update from master
[osm/devops.git] / installers / charm / osm-nbi / tests / unit / test_charm.py
index 87afafa..f4d10c7 100644 (file)
@@ -37,6 +37,7 @@ def harness(mocker: MockerFixture):
     mocker.patch("charm.KubernetesServicePatch", lambda x, y: None)
     harness = Harness(OsmNbiCharm)
     harness.begin()
+    harness.container_pebble_ready(container_name)
     yield harness
     harness.cleanup()
 
@@ -46,7 +47,7 @@ def test_missing_relations(harness: Harness):
     assert type(harness.charm.unit.status) == BlockedStatus
     assert all(
         relation in harness.charm.unit.status.message
-        for relation in ["mongodb", "kafka", "prometheus", "keystone"]
+        for relation in ["mongodb", "kafka", "prometheus", "keystone", "temporal"]
     )
 
 
@@ -81,7 +82,9 @@ def _add_relations(harness: Harness):
     relation_id = harness.add_relation("mongodb", "mongodb")
     harness.add_relation_unit(relation_id, "mongodb/0")
     harness.update_relation_data(
-        relation_id, "mongodb/0", {"connection_string": "mongodb://:1234"}
+        relation_id,
+        "mongodb",
+        {"uris": "mongodb://:1234", "username": "user", "password": "password"},
     )
     relation_ids.append(relation_id)
     # Add kafka relation
@@ -118,4 +121,9 @@ def _add_relations(harness: Harness):
         },
     )
     relation_ids.append(relation_id)
+    # Add temporal relation
+    relation_id = harness.add_relation("temporal", "temporal")
+    harness.add_relation_unit(relation_id, "temporal/0")
+    harness.update_relation_data(relation_id, "temporal", {"host": "temporal", "port": "7233"})
+    relation_ids.append(relation_id)
     return relation_ids