Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arturo-seijas committed Jun 6, 2024
1 parent f2aa9e6 commit 2caba7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,11 @@ def exec_handler(args: ops.testing.ExecArgs) -> None:
for call in exec_calls:
harness.handle_exec(SERVICE_NAME, call, handler=exec_handler)

# The leader-elected event will cause rollingops to fail because the RollingOpsManager has not
# yet been initilised in the charm's __init__ method.
harness.disable_hooks()
harness.set_leader(True)
harness.enable_hooks()
harness.container_pebble_ready(SERVICE_NAME)
# A few events are not emitted, like config_changed.
harness.charm.on.start.emit()
Expand Down

0 comments on commit 2caba7d

Please sign in to comment.