Skip to content

Commit

Permalink
Merge pull request #135 from tonyandrewmeyer/fix-bad-merging-to-7
Browse files Browse the repository at this point in the history
fix: add missing methods and fix broken string
  • Loading branch information
tonyandrewmeyer authored May 31, 2024
2 parents ed1d557 + 469de89 commit 76eb246
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,15 @@ def trigger(
if post_event:
post_event(mgr.charm)
return state_out


def sort_patch(patch: List[Dict], key=lambda obj: obj["path"] + obj["op"]):
return sorted(patch, key=key)


def jsonpatch_delta(self, other: "State"):
patch = jsonpatch.make_patch(
dataclasses.asdict(other),
dataclasses.asdict(self),
).patch
return sort_patch(patch)

0 comments on commit 76eb246

Please sign in to comment.