Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: ops.Model.get_relation should not raise when a relation with the specified ID does not exist #194

Merged

Conversation

tonyandrewmeyer
Copy link
Collaborator

State.get_relation raises KeyError when no matching relation can be found, so adjust the mocking to expect that rather than ValueError as previously.

Add a test that validates the various results of ops.Model.get_relation when the relation doesn't exist.

Fixes #193

@PietroPasotti PietroPasotti merged commit 0581355 into canonical:main Sep 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyError when using model.get_relation when relation does not exist
2 participants