summaryrefslogtreecommitdiff
path: root/lib/python/qmk/tests/test_cli_commands.py
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-02-28 20:03:22 +0000
committerQMK Bot <hello@qmk.fm>2022-02-28 20:03:22 +0000
commit36e47cb3aaa6380764ab23e2b0308bf689156aa7 (patch)
treef762d5f9f497432cb4dca6fa016c254f1065de9b /lib/python/qmk/tests/test_cli_commands.py
parent3c7c9bdd8614cd332b4db7ab6d05429d513ba11d (diff)
parentfbfd5312b995a32af690c183cad0dc988f695e89 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/tests/test_cli_commands.py')
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index c379c92229..d5cf1841c9 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -156,6 +156,18 @@ def test_json2c_stdin():
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'
+def test_json2c_wrong_json():
+ result = check_subcommand('json2c', 'keyboards/handwired/pytest/info.json')
+ check_returncode(result, [1])
+ assert 'Invalid JSON keymap' in result.stdout
+
+
+def test_json2c_no_json():
+ result = check_subcommand('json2c', 'keyboards/handwired/pytest/pytest.h')
+ check_returncode(result, [1])
+ assert 'Invalid JSON encountered' in result.stdout
+
+
def test_info():
result = check_subcommand('info', '-kb', 'handwired/pytest/basic')
check_returncode(result)