Update from master
[osm/devops.git] / installers / charm / osm-pol / tests / unit / test_charm.py
index 3767539..1b5013a 100644 (file)
@@ -36,6 +36,7 @@ service_name = "pol"
 def harness(mocker: MockerFixture):
     harness = Harness(OsmPolCharm)
     harness.begin()
+    harness.container_pebble_ready(container_name)
     yield harness
     harness.cleanup()
 
@@ -69,13 +70,15 @@ 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
     relation_id = harness.add_relation("kafka", "kafka")
     harness.add_relation_unit(relation_id, "kafka/0")
-    harness.update_relation_data(relation_id, "kafka", {"host": "kafka", "port": 9092})
+    harness.update_relation_data(relation_id, "kafka", {"host": "kafka", "port": "9092"})
     relation_ids.append(relation_id)
     # Add mysql relation
     relation_id = harness.add_relation("mysql", "mysql")
@@ -85,7 +88,7 @@ def _add_relations(harness: Harness):
         "mysql/0",
         {
             "host": "mysql",
-            "port": 3306,
+            "port": "3306",
             "user": "mano",
             "password": "manopw",
             "root_password": "rootmanopw",