diff options
Diffstat (limited to 'lib/python/qmk/tests')
| -rw-r--r-- | lib/python/qmk/tests/minimal_info.json | 2 | ||||
| -rw-r--r-- | lib/python/qmk/tests/test_cli_commands.py | 22 |
2 files changed, 14 insertions, 10 deletions
diff --git a/lib/python/qmk/tests/minimal_info.json b/lib/python/qmk/tests/minimal_info.json index b91c23bd3..11ef12fef 100644 --- a/lib/python/qmk/tests/minimal_info.json +++ b/lib/python/qmk/tests/minimal_info.json | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | { | 1 | { |
| 2 | "keyboard_name": "tester", | 2 | "keyboard_name": "tester", |
| 3 | "maintainer": "qmk", | 3 | "maintainer": "qmk", |
| 4 | "height": 5, | ||
| 5 | "width": 15, | ||
| 6 | "layouts": { | 4 | "layouts": { |
| 7 | "LAYOUT": { | 5 | "LAYOUT": { |
| 8 | "layout": [ | 6 | "layout": [ |
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index afdbc8142..b39fe5e46 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py | |||
| @@ -31,13 +31,13 @@ def check_returncode(result, expected=[0]): | |||
| 31 | assert result.returncode in expected | 31 | assert result.returncode in expected |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | def test_cformat(): | 34 | def test_format_c(): |
| 35 | result = check_subcommand('cformat', '-n', 'quantum/matrix.c') | 35 | result = check_subcommand('format-c', '-n', 'quantum/matrix.c') |
| 36 | check_returncode(result) | 36 | check_returncode(result) |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | def test_cformat_all(): | 39 | def test_format_c_all(): |
| 40 | result = check_subcommand('cformat', '-n', '-a') | 40 | result = check_subcommand('format-c', '-n', '-a') |
| 41 | check_returncode(result, [0, 1]) | 41 | check_returncode(result, [0, 1]) |
| 42 | 42 | ||
| 43 | 43 | ||
| @@ -80,8 +80,8 @@ def test_hello(): | |||
| 80 | assert 'Hello,' in result.stdout | 80 | assert 'Hello,' in result.stdout |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | def test_pyformat(): | 83 | def test_format_python(): |
| 84 | result = check_subcommand('pyformat', '--dry-run') | 84 | result = check_subcommand('format-python', '--dry-run') |
| 85 | check_returncode(result) | 85 | check_returncode(result) |
| 86 | assert 'Python code in `bin/qmk` and `lib/python` is correctly formatted.' in result.stdout | 86 | assert 'Python code in `bin/qmk` and `lib/python` is correctly formatted.' in result.stdout |
| 87 | 87 | ||
| @@ -258,6 +258,12 @@ def test_generate_rules_mk(): | |||
| 258 | assert 'MCU ?= atmega32u4' in result.stdout | 258 | assert 'MCU ?= atmega32u4' in result.stdout |
| 259 | 259 | ||
| 260 | 260 | ||
| 261 | def test_generate_version_h(): | ||
| 262 | result = check_subcommand('generate-version-h') | ||
| 263 | check_returncode(result) | ||
| 264 | assert '#define QMK_VERSION' in result.stdout | ||
| 265 | |||
| 266 | |||
| 261 | def test_generate_layouts(): | 267 | def test_generate_layouts(): |
| 262 | result = check_subcommand('generate-layouts', '-kb', 'handwired/pytest/basic') | 268 | result = check_subcommand('generate-layouts', '-kb', 'handwired/pytest/basic') |
| 263 | check_returncode(result) | 269 | check_returncode(result) |
| @@ -267,7 +273,7 @@ def test_generate_layouts(): | |||
| 267 | def test_format_json_keyboard(): | 273 | def test_format_json_keyboard(): |
| 268 | result = check_subcommand('format-json', '--format', 'keyboard', 'lib/python/qmk/tests/minimal_info.json') | 274 | result = check_subcommand('format-json', '--format', 'keyboard', 'lib/python/qmk/tests/minimal_info.json') |
| 269 | check_returncode(result) | 275 | check_returncode(result) |
| 270 | assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "height": 5,\n "width": 15,\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n' | 276 | assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n' |
| 271 | 277 | ||
| 272 | 278 | ||
| 273 | def test_format_json_keymap(): | 279 | def test_format_json_keymap(): |
| @@ -279,7 +285,7 @@ def test_format_json_keymap(): | |||
| 279 | def test_format_json_keyboard_auto(): | 285 | def test_format_json_keyboard_auto(): |
| 280 | result = check_subcommand('format-json', '--format', 'auto', 'lib/python/qmk/tests/minimal_info.json') | 286 | result = check_subcommand('format-json', '--format', 'auto', 'lib/python/qmk/tests/minimal_info.json') |
| 281 | check_returncode(result) | 287 | check_returncode(result) |
| 282 | assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "height": 5,\n "width": 15,\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n' | 288 | assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n' |
| 283 | 289 | ||
| 284 | 290 | ||
| 285 | def test_format_json_keymap_auto(): | 291 | def test_format_json_keymap_auto(): |
