aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/tests/test_cli_commands.py
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-02-28 07:22:21 +1100
committerNick Brassel <nick@tzarc.org>2021-02-28 07:22:21 +1100
commit1a5f6b54aff179732e3f4f4eb79e47454f0a1eb5 (patch)
treeebf645f55cb0442899c894765b1af4344fb734db /lib/python/qmk/tests/test_cli_commands.py
parent804d5c1c5d59d9a12c1d793289ccbd59cb650ec2 (diff)
parent624359b725c9bfe8176cf72cdc2c8bbb7513949f (diff)
downloadqmk_firmware-1a5f6b54aff179732e3f4f4eb79e47454f0a1eb5.tar.gz
qmk_firmware-1a5f6b54aff179732e3f4f4eb79e47454f0a1eb5.zip
2021 February 27 Breaking Changes Update (#12040)
Diffstat (limited to 'lib/python/qmk/tests/test_cli_commands.py')
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index f889833d0..82c42a20e 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -16,7 +16,7 @@ def check_subcommand(command, *args):
16def check_subcommand_stdin(file_to_read, command, *args): 16def check_subcommand_stdin(file_to_read, command, *args):
17 """Pipe content of a file to a command and return output. 17 """Pipe content of a file to a command and return output.
18 """ 18 """
19 with open(file_to_read) as my_file: 19 with open(file_to_read, encoding='utf-8') as my_file:
20 cmd = ['bin/qmk', command, *args] 20 cmd = ['bin/qmk', command, *args]
21 result = run(cmd, stdin=my_file, stdout=PIPE, stderr=STDOUT, universal_newlines=True) 21 result = run(cmd, stdin=my_file, stdout=PIPE, stderr=STDOUT, universal_newlines=True)
22 return result 22 return result
@@ -230,3 +230,32 @@ def test_generate_rgb_breathe_table():
230 check_returncode(result) 230 check_returncode(result)
231 assert 'Breathing center: 1.2' in result.stdout 231 assert 'Breathing center: 1.2' in result.stdout
232 assert 'Breathing max: 127' in result.stdout 232 assert 'Breathing max: 127' in result.stdout
233
234
235def test_generate_config_h():
236 result = check_subcommand('generate-config-h', '-kb', 'handwired/pytest/basic')
237 check_returncode(result)
238 assert '# define DEVICE_VER 0x0001' in result.stdout
239 assert '# define DESCRIPTION handwired/pytest/basic' in result.stdout
240 assert '# define DIODE_DIRECTION COL2ROW' in result.stdout
241 assert '# define MANUFACTURER none' in result.stdout
242 assert '# define PRODUCT handwired/pytest/basic' in result.stdout
243 assert '# define PRODUCT_ID 0x6465' in result.stdout
244 assert '# define VENDOR_ID 0xFEED' in result.stdout
245 assert '# define MATRIX_COLS 1' in result.stdout
246 assert '# define MATRIX_COL_PINS { F4 }' in result.stdout
247 assert '# define MATRIX_ROWS 1' in result.stdout
248 assert '# define MATRIX_ROW_PINS { F5 }' in result.stdout
249
250
251def test_generate_rules_mk():
252 result = check_subcommand('generate-rules-mk', '-kb', 'handwired/pytest/basic')
253 check_returncode(result)
254 assert 'BOOTLOADER ?= atmel-dfu' in result.stdout
255 assert 'MCU ?= atmega32u4' in result.stdout
256
257
258def test_generate_layouts():
259 result = check_subcommand('generate-layouts', '-kb', 'handwired/pytest/basic')
260 check_returncode(result)
261 assert '#define LAYOUT_custom(k0A) {' in result.stdout