diff options
| author | Ryan <fauxpark@gmail.com> | 2024-08-04 01:55:02 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-03 16:55:02 +0100 |
| commit | 9f387f525cb7f9099c4a90ad42d1195c1901c2a3 (patch) | |
| tree | cb12307a24ad221609158a33684ba0a0351def68 /lib/python/qmk/tests/test_cli_commands.py | |
| parent | 807ba71c897cae04ed3191267545636858404438 (diff) | |
Remove `handwired/pytest/has_template` (#24232)
Diffstat (limited to 'lib/python/qmk/tests/test_cli_commands.py')
| -rw-r--r-- | lib/python/qmk/tests/test_cli_commands.py | 78 |
1 files changed, 58 insertions, 20 deletions
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index 8b50d1c340..674bb54be2 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py | |||
| @@ -142,9 +142,34 @@ def test_list_keymaps_no_keyboard_found(): | |||
| 142 | 142 | ||
| 143 | 143 | ||
| 144 | def test_json2c(): | 144 | def test_json2c(): |
| 145 | result = check_subcommand('json2c', 'keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json') | 145 | result = check_subcommand('json2c', 'keyboards/handwired/pytest/basic/keymaps/default_json/keymap.json') |
| 146 | check_returncode(result) | 146 | check_returncode(result) |
| 147 | assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n\n' | 147 | assert result.stdout == """#include QMK_KEYBOARD_H |
| 148 | #if __has_include("keymap.h") | ||
| 149 | # include "keymap.h" | ||
| 150 | #endif | ||
| 151 | |||
| 152 | |||
| 153 | /* THIS FILE WAS GENERATED! | ||
| 154 | * | ||
| 155 | * This file was generated by qmk json2c. You may or may not want to | ||
| 156 | * edit it directly. | ||
| 157 | */ | ||
| 158 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 159 | \t[0] = LAYOUT_ortho_1x1(KC_A) | ||
| 160 | }; | ||
| 161 | |||
| 162 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 163 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | ||
| 164 | |||
| 165 | }; | ||
| 166 | #endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 167 | |||
| 168 | |||
| 169 | |||
| 170 | |||
| 171 | |||
| 172 | """ | ||
| 148 | 173 | ||
| 149 | 174 | ||
| 150 | def test_json2c_macros(): | 175 | def test_json2c_macros(): |
| @@ -156,9 +181,34 @@ def test_json2c_macros(): | |||
| 156 | 181 | ||
| 157 | 182 | ||
| 158 | def test_json2c_stdin(): | 183 | def test_json2c_stdin(): |
| 159 | result = check_subcommand_stdin('keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json', 'json2c', '-') | 184 | result = check_subcommand_stdin('keyboards/handwired/pytest/basic/keymaps/default_json/keymap.json', 'json2c', '-') |
| 160 | check_returncode(result) | 185 | check_returncode(result) |
| 161 | assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n\n' | 186 | assert result.stdout == """#include QMK_KEYBOARD_H |
| 187 | #if __has_include("keymap.h") | ||
| 188 | # include "keymap.h" | ||
| 189 | #endif | ||
| 190 | |||
| 191 | |||
| 192 | /* THIS FILE WAS GENERATED! | ||
| 193 | * | ||
| 194 | * This file was generated by qmk json2c. You may or may not want to | ||
| 195 | * edit it directly. | ||
| 196 | */ | ||
| 197 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 198 | \t[0] = LAYOUT_ortho_1x1(KC_A) | ||
| 199 | }; | ||
| 200 | |||
| 201 | #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 202 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | ||
| 203 | |||
| 204 | }; | ||
| 205 | #endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) | ||
| 206 | |||
| 207 | |||
| 208 | |||
| 209 | |||
| 210 | |||
| 211 | """ | ||
| 162 | 212 | ||
| 163 | 213 | ||
| 164 | def test_json2c_wrong_json(): | 214 | def test_json2c_wrong_json(): |
| @@ -223,27 +273,15 @@ def test_info_matrix_render(): | |||
| 223 | 273 | ||
| 224 | 274 | ||
| 225 | def test_c2json(): | 275 | def test_c2json(): |
| 226 | result = check_subcommand("c2json", "-kb", "handwired/pytest/has_template", "-km", "default", "keyboards/handwired/pytest/has_template/keymaps/default/keymap.c") | 276 | result = check_subcommand("c2json", "-kb", "handwired/pytest/basic", "-km", "default", "keyboards/handwired/pytest/basic/keymaps/default/keymap.c") |
| 227 | check_returncode(result) | 277 | check_returncode(result) |
| 228 | assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}' | 278 | assert result.stdout.strip() == '{"keyboard": "handwired/pytest/basic", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}' |
| 229 | |||
| 230 | |||
| 231 | def test_c2json_nocpp(): | ||
| 232 | result = check_subcommand("c2json", "--no-cpp", "-kb", "handwired/pytest/has_template", "-km", "default", "keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c") | ||
| 233 | check_returncode(result) | ||
| 234 | assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT", "layers": [["KC_ENTER"]]}' | ||
| 235 | 279 | ||
| 236 | 280 | ||
| 237 | def test_c2json_stdin(): | 281 | def test_c2json_stdin(): |
| 238 | result = check_subcommand_stdin("keyboards/handwired/pytest/has_template/keymaps/default/keymap.c", "c2json", "-kb", "handwired/pytest/has_template", "-km", "default", "-") | 282 | result = check_subcommand_stdin("keyboards/handwired/pytest/basic/keymaps/default/keymap.c", "c2json", "-kb", "handwired/pytest/basic", "-km", "default", "-") |
| 239 | check_returncode(result) | ||
| 240 | assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}' | ||
| 241 | |||
| 242 | |||
| 243 | def test_c2json_nocpp_stdin(): | ||
| 244 | result = check_subcommand_stdin("keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c", "c2json", "--no-cpp", "-kb", "handwired/pytest/has_template", "-km", "default", "-") | ||
| 245 | check_returncode(result) | 283 | check_returncode(result) |
| 246 | assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT", "layers": [["KC_ENTER"]]}' | 284 | assert result.stdout.strip() == '{"keyboard": "handwired/pytest/basic", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}' |
| 247 | 285 | ||
| 248 | 286 | ||
| 249 | def test_clean(): | 287 | def test_clean(): |
