mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-17 17:35:30 +00:00
Fix test logic to check for both keymaps (#17761)
Python will evaluate first the left and then the right side of the and operator. The left side would previously return True based on the truthiness logic that treats any non-emptry string as true. It would not check if the desired keymap exists. If the left side is true it will evaluate the right side which will check for the existance of a specific keymap. With this change the check for existance of two keymaps is implemented.
This commit is contained in:
parent
2202efaf0c
commit
1f42a8ccdd
1 changed files with 10 additions and 5 deletions
|
@ -97,13 +97,15 @@ def test_list_keyboards():
|
|||
def test_list_keymaps():
|
||||
result = check_subcommand('list-keymaps', '-kb', 'handwired/pytest/basic')
|
||||
check_returncode(result)
|
||||
assert 'default' and 'default_json' in result.stdout
|
||||
assert 'default' in result.stdout
|
||||
assert 'default_json' in result.stdout
|
||||
|
||||
|
||||
def test_list_keymaps_long():
|
||||
result = check_subcommand('list-keymaps', '--keyboard', 'handwired/pytest/basic')
|
||||
check_returncode(result)
|
||||
assert 'default' and 'default_json' in result.stdout
|
||||
assert 'default' in result.stdout
|
||||
assert 'default_json' in result.stdout
|
||||
|
||||
|
||||
def test_list_keymaps_community():
|
||||
|
@ -115,19 +117,22 @@ def test_list_keymaps_community():
|
|||
def test_list_keymaps_kb_only():
|
||||
result = check_subcommand('list-keymaps', '-kb', 'contra')
|
||||
check_returncode(result)
|
||||
assert 'default' and 'via' in result.stdout
|
||||
assert 'default' in result.stdout
|
||||
assert 'via' in result.stdout
|
||||
|
||||
|
||||
def test_list_keymaps_vendor_kb():
|
||||
result = check_subcommand('list-keymaps', '-kb', 'ai03/lunar')
|
||||
check_returncode(result)
|
||||
assert 'default' and 'via' in result.stdout
|
||||
assert 'default' in result.stdout
|
||||
assert 'via' in result.stdout
|
||||
|
||||
|
||||
def test_list_keymaps_vendor_kb_rev():
|
||||
result = check_subcommand('list-keymaps', '-kb', 'kbdfans/kbd67/mkiirgb/v2')
|
||||
check_returncode(result)
|
||||
assert 'default' and 'via' in result.stdout
|
||||
assert 'default' in result.stdout
|
||||
assert 'via' in result.stdout
|
||||
|
||||
|
||||
def test_list_keymaps_no_keyboard_found():
|
||||
|
|
Loading…
Reference in a new issue