Skip to content

Commit

Permalink
Fix merging.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Jul 24, 2024
1 parent c8a7c75 commit 51a1110
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scenario/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def _record_status(self, state: "State", is_app: bool):
else:
self.unit_status_history.append(state.unit_status)

def __call__(self, event: Union["_Event", "Action"], state: "State"):
def __call__(self, event: Union["_Event", "_Action"], state: "State"):
"""Context manager to introspect live charm object before and after the event is emitted.
Usage::
Expand All @@ -619,7 +619,7 @@ def __call__(self, event: Union["_Event", "Action"], state: "State"):
event: the :class:`Event` or :class:`Action` that the charm will respond to.
state: the :class:`State` instance to use when handling the Event.
"""
if isinstance(event, Action) or event.action:
if isinstance(event, _Action) or event.action:
return _ActionManager(self, event, state)
return _EventManager(self, event, state)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ops import CharmBase

from scenario import ActionOutput, Context, State
from scenario.state import _Action, _Event, next_action_id
from scenario.state import _Event, next_action_id


class MyCharm(CharmBase):
Expand Down Expand Up @@ -65,7 +65,7 @@ def test_context_manager():
event.run()
assert event.charm.meta.name == "foo"

with ctx(Action("act"), state) as event:
with ctx(ctx.on.action("act"), state) as event:
event.run_action()
assert event.charm.meta.name == "foo"

Expand Down

0 comments on commit 51a1110

Please sign in to comment.