Skip to content

Commit

Permalink
Fix things after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Erovia committed Jul 2, 2020
1 parent 032686e commit 1b44d5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/python/qmk/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import platform
from subprocess import PIPE # noqa, so other submodules doesn't need to
from subprocess import STDOUT # noqa, so other submodules doesn't need to
from subprocess import run as sprun
import shlex
import shutil
Expand Down
10 changes: 5 additions & 5 deletions lib/python/qmk/tests/test_cli_commands.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from qmk.commands import run, PIPE
from qmk.commands import run, STDOUT, PIPE


def check_subcommand(command, *args):
cmd = ['bin/qmk', command] + list(args)
result = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
result = run(cmd, stdout=PIPE, stderr=STDOUT, universal_newlines=True)
return result


Expand Down Expand Up @@ -159,11 +159,11 @@ def test_info_matrix_render():

def test_c2json():
result = check_subcommand("c2json", "-kb", "handwired/onekey/pytest", "keyboards/handwired/onekey/keymaps/default/keymap.c")
assert result.returncode == 0
assert result.stdout.strip() == '{"keyboard": "handwired/onekey/pytest", "documentation": "This file is a keymap.json file for handwired/onekey/pytest", "layout": "LAYOUT", "layers": [["KC_A"]]}'
check_returncode(result)
assert result.stdout.strip() == '{"keyboard": "handwired/onekey/pytest", "documentation": "This file is a keymap.json file for handwired/onekey/pytest", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}'


def test_c2json_nocpp():
result = check_subcommand("c2json", "--no-cpp", "-kb", "handwired/onekey/pytest", "keyboards/handwired/onekey/keymaps/pytest_nocpp/keymap.c")
assert result.returncode == 0
check_returncode(result)
assert result.stdout.strip() == '{"keyboard": "handwired/onekey/pytest", "documentation": "This file is a keymap.json file for handwired/onekey/pytest", "layout": "LAYOUT", "layers": [["KC_ENTER"]]}'
2 changes: 1 addition & 1 deletion lib/python/qmk/tests/test_qmk_keymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_generate_onekey_pytest_json():

def test_parse_keymap_c():
parsed_keymap_c = qmk.keymap.parse_keymap_c('keyboards/handwired/onekey/keymaps/default/keymap.c')
assert parsed_keymap_c == {'layers': [{'name': '0', 'layout': 'LAYOUT', 'keycodes': ['KC_A']}]}
assert parsed_keymap_c == {'layers': [{'name': '0', 'layout': 'LAYOUT_ortho_1x1', 'keycodes': ['KC_A']}]}


# FIXME(skullydazed): Add a test for qmk.keymap.write that mocks up an FD.

0 comments on commit 1b44d5a

Please sign in to comment.