Skip to content

Commit

Permalink
Merge pull request #23 from canonical/frozen-state
Browse files Browse the repository at this point in the history
frozen dataclasses for python 3.11 compatibility
  • Loading branch information
PietroPasotti authored Apr 24, 2023
2 parents 3231860 + cf337fc commit c6fdc31
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 75 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ops-scenario"

version = "2.1.3.5"
version = "2.2"
authors = [
{ name = "Pietro Pasotti", email = "[email protected]" }
]
Expand Down
9 changes: 5 additions & 4 deletions scenario/mocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def secret_get(
if peek or refresh:
revision = max(secret.contents.keys())
if refresh:
secret.revision = revision
secret._set_revision(revision)

return secret.contents[revision]

Expand Down Expand Up @@ -298,6 +298,10 @@ def secret_remove(self, id: str, *, revision: Optional[int] = None):
else:
secret.contents.clear()

def relation_remote_app_name(self, relation_id: int):
relation = self._get_relation_by_id(relation_id)
return relation.remote_app_name

# TODO:
def action_set(self, *args, **kwargs):
raise NotImplementedError("action_set")
Expand All @@ -314,9 +318,6 @@ def storage_add(self, *args, **kwargs):
def action_get(self):
raise NotImplementedError("action_get")

def relation_remote_app_name(self, *args, **kwargs):
raise NotImplementedError("relation_remote_app_name")

def resource_get(self, *args, **kwargs):
raise NotImplementedError("resource_get")

Expand Down
Loading

0 comments on commit c6fdc31

Please sign in to comment.