forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d339b7
commit 5b7a5b2
Showing
15 changed files
with
130 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* Copyright 2019 | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "config_common.h" | ||
|
||
#define MATRIX_COL_PINS { A3 } | ||
#define MATRIX_ROW_PINS { A2 } | ||
#define UNUSED_PINS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# PyTest onekey | ||
|
||
This is used by the python test framework. It's probably not useful otherwise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# MCU name | ||
MCU = STM32F303 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""QMK Python Unit Tests | ||
QMK script to run unit and integration tests against our python code. | ||
""" | ||
from milc import cli | ||
|
||
|
||
@cli.entrypoint('QMK Python Unit Tests') | ||
def main(cli): | ||
"""Use nose2 to run unittests | ||
""" | ||
try: | ||
import nose2 | ||
except ImportError: | ||
cli.log.error('Could not import nose2! Please install it with {fg_cyan}pip3 install nose2') | ||
return False | ||
|
||
nose2.discover() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class AttrDict(dict): | ||
"""A dictionary that can be accessed by attributes. | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"keyboard":"handwired/onekey/pytest", | ||
"keymap":"pytest_unittest", | ||
"layout":"LAYOUT", | ||
"layers":[["KC_A"]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from qmk.errors import NoSuchKeyboardError | ||
|
||
def test_NoSuchKeyboardError(): | ||
try: | ||
raise(NoSuchKeyboardError("test message")) | ||
except NoSuchKeyboardError as e: | ||
assert e.message == 'test message' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import qmk.keymap | ||
|
||
def test_template_onekey_proton_c(): | ||
templ = qmk.keymap.template('handwired/onekey/proton_c') | ||
assert templ == qmk.keymap.DEFAULT_KEYMAP_C | ||
|
||
|
||
def test_template_onekey_pytest(): | ||
templ = qmk.keymap.template('handwired/onekey/pytest') | ||
assert templ == 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};\n' | ||
|
||
|
||
def test_generate_onekey_pytest(): | ||
templ = qmk.keymap.generate('handwired/onekey/pytest', 'LAYOUT', [['KC_A']]) | ||
assert templ == 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT(KC_A)};\n' | ||
|
||
|
||
# FIXME(skullydazed): Add a test for qmk.keymap.write that mocks up an FD. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
|
||
import qmk.path | ||
|
||
def test_keymap_onekey_pytest(): | ||
path = qmk.path.keymap('handwired/onekey/pytest') | ||
assert path == 'keyboards/handwired/onekey/keymaps' | ||
|
||
|
||
def test_normpath(): | ||
path = qmk.path.normpath('lib/python') | ||
assert path == os.environ['ORIG_CWD'] + '/lib/python' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[unittest] | ||
start-dir = lib/python/qmk/tests |