We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d4d71b commit b25568dCopy full SHA for b25568d
server/charm/tests/unit/test_charm.py
@@ -8,6 +8,7 @@
8
from unittest.mock import patch
9
10
import ops
11
+import pytest
12
from ops import testing
13
14
from charm import HardwareApiCharm
@@ -53,8 +54,9 @@ def test_config_changed_invalid_log_level():
53
54
containers={container},
55
leader=True,
56
)
- state_out = ctx.run(ctx.on.config_changed(), state_in)
57
- assert state_out.unit_status == testing.BlockedStatus("invalid log level: 'invalid'")
+ with pytest.raises(testing.errors.UncaughtCharmError):
58
+ state_out = ctx.run(ctx.on.config_changed(), state_in)
59
+ assert isinstance(state_out.unit_status, testing.BlockedStatus)
60
61
62
def test_config_changed_pebble_not_ready():
0 commit comments