Skip to content

Commit

Permalink
#126: fix MakeNote.key_to_log not being updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygoy committed Feb 14, 2024
1 parent 1c8a8b2 commit 8cd3c33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions screenpy/actions/make_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class MakeNote:
"""

key: str | None
key_to_log: str | None
question: T_Q

@classmethod
Expand All @@ -56,6 +57,7 @@ def of_the(cls, question: T_Q) -> Self:
def as_(self, key: str) -> Self:
"""Set the key to use to recall this noted value."""
self.key = key
self.key_to_log = represent_prop(key)
return self

def describe(self) -> str:
Expand Down
1 change: 1 addition & 0 deletions tests/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ def test_key_value_set(self) -> None:

assert mn.question == test_question
assert mn.key == test_key
assert mn.key_to_log == f"'{test_key}'"

def test_answers_question(self, Tester: Actor) -> None:
mock_question = FakeQuestion()
Expand Down

0 comments on commit 8cd3c33

Please sign in to comment.