test: Add test for capswords

This commit is contained in:
Dave Bendit 2022-11-21 06:10:17 +00:00 committed by xs5871
parent afd4982925
commit 7115774633

28
tests/test_capsword.py Normal file
View File

@ -0,0 +1,28 @@
import unittest
from kmk.keys import KC
from kmk.modules.capsword import CapsWord
from tests.keyboard_test import KeyboardTest
#TODO: Add tests for custom and default ignored keys, custom and default timeouts
class TestCapsWord(unittest.TestCase):
def setUp(self):
self.kb = KeyboardTest(
[CapsWord()],
[
[KC.CW, KC.A, KC.Z, KC.N1, KC.N0, KC.SPC],
],
debug_enabled=False,
)
def test_capsword(self):
self.kb.test(
'CapsWord',
[(1, True), (1, False), (0, True), (0, False), (1, True), (1, False), (2, True), (2, False), (3, True), (3, False), (4, True), (4, False), (1, True), (1, False), (5, True), (5, False), (1, True), (1, False)],
[{KC.A}, {}, {KC.LSFT, KC.A}, {}, {KC.LSFT, KC.Z}, {}, {KC.N1}, {}, {KC.N0}, {}, {KC.LSFT, KC.A}, {}, {KC.SPC}, {}, {KC.A}, {}],
)
if __name__ == '__main__':
unittest.main()