Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tests: relation_broken.emit() takes a relation, not a relation ID #369

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/unit/test_source_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading