summaryrefslogtreecommitdiff
path: root/lib/python/qmk
diff options
context:
space:
mode:
authorcodecoffeecode <lyharris8@gmail.com>2020-05-16 13:47:07 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commitc5ec960a11909ba9c27b3facae95cebfe9b6e256 (patch)
treea593a91eac08c9cf9026b902d7c516dc42f5bd74 /lib/python/qmk
parentdc99dab28318d49f35f744b23a8a638be984299a (diff)
Adding unit tests for list-keymaps command (#7711)
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> Co-Authored-By: Erovia <Erovia@users.noreply.github.com>
Diffstat (limited to 'lib/python/qmk')
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py36
1 files changed, 26 insertions, 10 deletions
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index 3b4e66a211..a93587150c 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -50,21 +50,37 @@ def test_pyformat():
assert 'Successfully formatted the python code' in result.stderr
-def test_list_keyboards():
- result = check_subcommand('list-keyboards')
+def test_list_keymaps():
+ result = check_subcommand('list-keymaps', '-kb', 'handwired/onekey/pytest')
assert result.returncode == 0
- # check to see if a known keyboard is returned
- # this will fail if handwired/onekey/pytest is removed
- assert 'handwired/onekey/pytest' in result.stdout
+ assert 'default' and 'test' in result.stdout
-def test_list_keymaps():
- result = check_subcommand("list-keymaps", "-kb", "handwired/onekey/pytest")
+def test_list_keymaps_long():
+ result = check_subcommand('list-keymaps', '--keyboard', 'handwired/onekey/pytest')
+ assert result.returncode == 0
+ assert 'default' and 'test' in result.stdout
+
+
+def test_list_keymaps_kb_only():
+ result = check_subcommand('list-keymaps', '-kb', 'niu_mini')
+ assert result.returncode == 0
+ assert 'default' and 'via' in result.stdout
+
+
+def test_list_keymaps_vendor_kb():
+ result = check_subcommand('list-keymaps', '-kb', 'ai03/lunar')
+ assert result.returncode == 0
+ assert 'default' and 'via' in result.stdout
+
+
+def test_list_keymaps_vendor_kb_rev():
+ result = check_subcommand('list-keymaps', '-kb', 'kbdfans/kbd67/mkiirgb/v2')
assert result.returncode == 0
- assert "default" and "test" in result.stdout
+ assert 'default' and 'via' in result.stdout
def test_list_keymaps_no_keyboard_found():
- result = check_subcommand("list-keymaps", "-kb", "asdfghjkl")
+ result = check_subcommand('list-keymaps', '-kb', 'asdfghjkl')
assert result.returncode == 0
- assert "does not exist" in result.stdout
+ assert 'does not exist' in result.stdout