mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-01-23 22:05:36 +00:00
Merge remote-tracking branch 'upstream/master' into firmware23
This commit is contained in:
@@ -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}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user