Skip to content

Commit

Permalink
Use a simpler name.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Apr 16, 2024
1 parent 52c2c93 commit 1c37b67
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scenario/mocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def __init__(
self._notices: Dict[Tuple[str, str], pebble.Notice] = {}
for container in state.containers:
for notice in container.notices:
self._notices[str(notice.type), notice.key] = notice._to_ops_notice()
self._notices[str(notice.type), notice.key] = notice._to_ops()

def get_plan(self) -> pebble.Plan:
return self._container.plan
Expand Down
2 changes: 1 addition & 1 deletion scenario/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ class Notice(_DCBase):
expire_after: Optional[datetime.timedelta] = None
"""How long since one of these last occurred until Pebble will drop the notice."""

def _to_ops_notice(self) -> pebble.Notice:
def _to_ops(self) -> pebble.Notice:
return pebble.Notice(
id=self.id,
user_id=self.user_id,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e/test_pebble.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,4 @@ def test_pebble_custom_notice(charm_cls):
ctx = Context(charm_cls, meta={"name": "foo", "containers": {"foo": {}}})
with ctx.manager(cont.notice_event, state) as mgr:
container = mgr.charm.unit.get_container("foo")
assert container.get_notices() == [n._to_ops_notice() for n in notices]
assert container.get_notices() == [n._to_ops() for n in notices]

0 comments on commit 1c37b67

Please sign in to comment.