summaryrefslogtreecommitdiff
path: root/lib/python/qmk/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/tests')
-rw-r--r--lib/python/qmk/tests/attrdict.py1
-rw-r--r--lib/python/qmk/tests/kle.txt5
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py11
-rw-r--r--lib/python/qmk/tests/test_qmk_errors.py2
-rw-r--r--lib/python/qmk/tests/test_qmk_path.py2
5 files changed, 17 insertions, 4 deletions
diff --git a/lib/python/qmk/tests/attrdict.py b/lib/python/qmk/tests/attrdict.py
index 391c75c4e1..a2584b9233 100644
--- a/lib/python/qmk/tests/attrdict.py
+++ b/lib/python/qmk/tests/attrdict.py
@@ -3,7 +3,6 @@ class AttrDict(dict):
This should only be used to mock objects for unit testing. Please do not use this outside of qmk.tests.
"""
-
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
diff --git a/lib/python/qmk/tests/kle.txt b/lib/python/qmk/tests/kle.txt
new file mode 100644
index 0000000000..862a899ab9
--- /dev/null
+++ b/lib/python/qmk/tests/kle.txt
@@ -0,0 +1,5 @@
+["¬\n`","!\n1","\"\n2","£\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace"],
+[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"Enter"],
+[{w:1.75},"Caps Lock","A","S","D","F","G","H","J","K","L",":\n;","@\n'","~\n#"],
+[{w:1.25},"Shift","|\n\\","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.75},"Shift"],
+[{w:1.25},"Ctrl",{w:1.25},"Win",{w:1.25},"Alt",{a:7,w:6.25},"",{a:4,w:1.25},"AltGr",{w:1.25},"Win",{w:1.25},"Menu",{w:1.25},"Ctrl"]
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index 9a9dc4b958..3f75cef3e1 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -7,19 +7,28 @@ def check_subcommand(command, *args):
def test_cformat():
- assert check_subcommand('cformat', 'tmk_core/common/backlight.c').returncode == 0
+ assert check_subcommand('cformat', 'tmk_core/common/keyboard.c').returncode == 0
def test_compile():
assert check_subcommand('compile', '-kb', 'handwired/onekey/pytest', '-km', 'default').returncode == 0
+def test_flash():
+ assert check_subcommand('flash', '-b').returncode == 1
+ assert check_subcommand('flash').returncode == 1
+
+
def test_config():
result = check_subcommand('config')
assert result.returncode == 0
assert 'general.color' in result.stdout
+def test_kle2json():
+ assert check_subcommand('kle2json', 'kle.txt', '-f').returncode == 0
+
+
def test_doctor():
result = check_subcommand('doctor')
assert result.returncode == 0
diff --git a/lib/python/qmk/tests/test_qmk_errors.py b/lib/python/qmk/tests/test_qmk_errors.py
index 1d8690b7ef..948e7ef741 100644
--- a/lib/python/qmk/tests/test_qmk_errors.py
+++ b/lib/python/qmk/tests/test_qmk_errors.py
@@ -1,7 +1,7 @@
from qmk.errors import NoSuchKeyboardError
-def test_NoSuchKeyboardError():
+def test_nosuchkeyboarderror():
try:
raise NoSuchKeyboardError("test message")
except NoSuchKeyboardError as e:
diff --git a/lib/python/qmk/tests/test_qmk_path.py b/lib/python/qmk/tests/test_qmk_path.py
index 94dbf3a6a6..d6961a0f65 100644
--- a/lib/python/qmk/tests/test_qmk_path.py
+++ b/lib/python/qmk/tests/test_qmk_path.py
@@ -10,4 +10,4 @@ def test_keymap_onekey_pytest():
def test_normpath():
path = qmk.path.normpath('lib/python')
- assert path == os.environ['ORIG_CWD'] + '/lib/python'
+ assert path == os.path.join(os.environ['ORIG_CWD'], 'lib/python')