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 | 16 | ||||
-rw-r--r-- | lib/python/qmk/tests/test_qmk_path.py | 4 |
3 files changed, 13 insertions, 9 deletions
diff --git a/lib/python/qmk/tests/minimal_info.json b/lib/python/qmk/tests/minimal_info.json index 3aae4722bf..7f5ec1f983 100644 --- a/lib/python/qmk/tests/minimal_info.json +++ b/lib/python/qmk/tests/minimal_info.json @@ -4,7 +4,7 @@ "layouts": { "LAYOUT": { "layout": [ - { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 } + {"label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0} ] } } diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index e598b281a6..1725e3ea79 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py @@ -144,7 +144,7 @@ def test_list_keymaps_no_keyboard_found(): def test_json2c(): result = check_subcommand('json2c', 'keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json') check_returncode(result) - 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' + 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' def test_json2c_macros(): @@ -158,7 +158,7 @@ def test_json2c_macros(): def test_json2c_stdin(): result = check_subcommand_stdin('keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json', 'json2c', '-') check_returncode(result) - 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' + 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' def test_json2c_wrong_json(): @@ -168,7 +168,7 @@ def test_json2c_wrong_json(): def test_json2c_no_json(): - result = check_subcommand('json2c', 'keyboards/handwired/pytest/pytest.h') + result = check_subcommand('json2c', 'keyboards/handwired/pytest/basic/keymaps/default/keymap.c') check_returncode(result, [1]) assert 'Invalid JSON encountered' in result.stdout @@ -188,7 +188,11 @@ def test_info_keyboard_render(): assert 'Keyboard Name: pytest' in result.stdout assert 'Processor: atmega32u4' in result.stdout assert 'Layouts:' in result.stdout - assert 'k0' in result.stdout + + if is_windows: + assert '| |' in result.stdout + else: + assert '│ │' in result.stdout def test_info_keymap_render(): @@ -291,7 +295,7 @@ def test_generate_version_h(): def test_format_json_keyboard(): result = check_subcommand('format-json', '--format', 'keyboard', 'lib/python/qmk/tests/minimal_info.json') check_returncode(result) - 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' + 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' def test_format_json_keymap(): @@ -303,7 +307,7 @@ def test_format_json_keymap(): def test_format_json_keyboard_auto(): result = check_subcommand('format-json', '--format', 'auto', 'lib/python/qmk/tests/minimal_info.json') check_returncode(result) - 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' + 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' def test_format_json_keymap_auto(): diff --git a/lib/python/qmk/tests/test_qmk_path.py b/lib/python/qmk/tests/test_qmk_path.py index 4b5132f13d..cc068e39da 100644 --- a/lib/python/qmk/tests/test_qmk_path.py +++ b/lib/python/qmk/tests/test_qmk_path.py @@ -5,8 +5,8 @@ import qmk.path def test_keymap_pytest_basic(): - path = qmk.path.keymap('handwired/pytest/basic') - assert path.samefile('keyboards/handwired/pytest/basic/keymaps') + path = qmk.path.keymap('handwired/pytest/basic', 'default') + assert path.samefile('keyboards/handwired/pytest/basic/keymaps/default') def test_normpath(): |