Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Dec 2, 2024
1 parent d610a52 commit ecbb6cc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions stimuli/keyboard/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def event() -> KeyEvent:
def test_KeyBuffer(event: KeyEvent):
"""Test the key buffer object."""
buffer = KeyBuffer()
assert buffer.events == [].pressed_keys.add("a")

assert buffer.events == []
buffer.events.append(event)
buffer.pressed_keys.add(event.key)
assert buffer.events == [event]
Expand All @@ -45,7 +44,7 @@ def test_KeyBuffer_get(event: KeyEvent):
"""Test the get method from a key buffer."""
buffer = KeyBuffer()
buffer.events.append(event)
buffer.pressed_keys.add("a")
buffer.pressed_keys.add(event.key)
assert buffer.pressed_keys == {"a"}
assert buffer.events == [event]
assert buffer.get() == [event]
Expand All @@ -57,8 +56,8 @@ def test_KeyBuffer_clear(event: KeyEvent):
"""Test the clear method from a key buffer."""
buffer = KeyBuffer()
buffer.events.append(event)
buffer.pressed_keys.add("a")
assert buffer.pressed_keys == {"a"}
buffer.pressed_keys.add(event.key)
assert buffer.pressed_keys == {event.key}
assert buffer.events == [event]
buffer.clear()
assert buffer.events == []
Expand Down

0 comments on commit ecbb6cc

Please sign in to comment.