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: raise ModelError on unknown/error status set in Scenario #1417

Merged

Conversation

tonyandrewmeyer
Copy link
Contributor

This copies across the fix from Harness to also be present in Scenario: if status_set is passed anything other than the valid statuses, then ModelError is raised (to better mimic what the Juju hook would actually do).

Closes canonical/ops-scenario#202 (rather than copying it over to this repo).

Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nit comments, but approving in advance.

testing/src/mocking.py Outdated Show resolved Hide resolved
testing/tests/test_e2e/test_status.py Outdated Show resolved Hide resolved
Co-authored-by: Ben Hoyt <benhoyt@gmail.com>
@dimaqq
Copy link
Contributor

dimaqq commented Oct 11, 2024

Looks good!

Copy link
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

testing/src/mocking.py Outdated Show resolved Hide resolved
@tonyandrewmeyer tonyandrewmeyer merged commit 68cf2d7 into canonical:main Oct 11, 2024
30 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the status_set_no_error_or_unknown branch October 11, 2024 04:05
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.

Make mocked status_set raise an error for 'error' or 'unknown' statuses
4 participants