From d9ff9679677df96208338c76e7e6691386176aec Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Thu, 19 Dec 2024 11:33:03 +1300 Subject: [PATCH] Emit takes the relation, not relation ID. --- tests/unit/test_source_consumer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_source_consumer.py b/tests/unit/test_source_consumer.py index 3cc2e3d0..7bdb816c 100644 --- a/tests/unit/test_source_consumer.py +++ b/tests/unit/test_source_consumer.py @@ -321,7 +321,8 @@ def test_consumer_noop_on_source_removal_if_not_leader(self): rel_id, "prometheus/0", {"grafana_source_host": "1.2.3.4:9090"} ) - self.harness.charm.on["grafana-source"].relation_broken.emit(rel_id) + rel = self.harness.charm.framework.model.get_relation("grafana-source", rel_id) # type: ignore + self.harness.charm.on["grafana-source"].relation_broken.emit(rel) self.assertEqual(self.harness.charm._stored.source_delete_events, 0) self.assertEqual(len(self.harness.charm.grafana_consumer.sources_to_delete), 0)