diff options
Diffstat (limited to 'lib/python/qmk/tests')
-rw-r--r-- | lib/python/qmk/tests/test_cli_commands.py | 6 | ||||
-rw-r--r-- | lib/python/qmk/tests/test_qmk_keymap.py | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index a93587150..768929de1 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py | |||
@@ -84,3 +84,9 @@ def test_list_keymaps_no_keyboard_found(): | |||
84 | result = check_subcommand('list-keymaps', '-kb', 'asdfghjkl') | 84 | result = check_subcommand('list-keymaps', '-kb', 'asdfghjkl') |
85 | assert result.returncode == 0 | 85 | assert result.returncode == 0 |
86 | assert 'does not exist' in result.stdout | 86 | assert 'does not exist' in result.stdout |
87 | |||
88 | |||
89 | def test_json2c(): | ||
90 | result = check_subcommand('json2c', 'keyboards/handwired/onekey/keymaps/default_json/keymap.json') | ||
91 | assert result.returncode == 0 | ||
92 | assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT(KC_A)};\n\n' | ||
diff --git a/lib/python/qmk/tests/test_qmk_keymap.py b/lib/python/qmk/tests/test_qmk_keymap.py index 2db625600..d8669e549 100644 --- a/lib/python/qmk/tests/test_qmk_keymap.py +++ b/lib/python/qmk/tests/test_qmk_keymap.py | |||
@@ -8,12 +8,12 @@ def test_template_onekey_proton_c(): | |||
8 | 8 | ||
9 | def test_template_onekey_pytest(): | 9 | def test_template_onekey_pytest(): |
10 | templ = qmk.keymap.template('handwired/onekey/pytest') | 10 | templ = qmk.keymap.template('handwired/onekey/pytest') |
11 | assert templ == 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};\n' | 11 | assert templ == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};\n' |
12 | 12 | ||
13 | 13 | ||
14 | def test_generate_onekey_pytest(): | 14 | def test_generate_onekey_pytest(): |
15 | templ = qmk.keymap.generate('handwired/onekey/pytest', 'LAYOUT', [['KC_A']]) | 15 | templ = qmk.keymap.generate('handwired/onekey/pytest', 'LAYOUT', [['KC_A']]) |
16 | assert templ == 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT(KC_A)};\n' | 16 | assert templ == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT(KC_A)};\n' |
17 | 17 | ||
18 | 18 | ||
19 | # FIXME(skullydazed): Add a test for qmk.keymap.write that mocks up an FD. | 19 | # FIXME(skullydazed): Add a test for qmk.keymap.write that mocks up an FD. |