From 5b7a5b2a7629fbb667d23a55836dce3c6c46a203 Mon Sep 17 00:00:00 2001 From: skullY Date: Wed, 21 Aug 2019 23:40:24 -0700 Subject: Setup a python test framework --- lib/python/qmk/tests/attrdict.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/python/qmk/tests/attrdict.py (limited to 'lib/python/qmk/tests/attrdict.py') diff --git a/lib/python/qmk/tests/attrdict.py b/lib/python/qmk/tests/attrdict.py new file mode 100644 index 0000000000..a2584b9233 --- /dev/null +++ b/lib/python/qmk/tests/attrdict.py @@ -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 -- cgit v1.2.3 From c7eede2249d22dd4fabed83043dcf4cc7408cf27 Mon Sep 17 00:00:00 2001 From: skullY Date: Wed, 21 Aug 2019 23:46:51 -0700 Subject: run yapf on the code --- lib/python/qmk/tests/attrdict.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/python/qmk/tests/attrdict.py') diff --git a/lib/python/qmk/tests/attrdict.py b/lib/python/qmk/tests/attrdict.py index a2584b9233..391c75c4e1 100644 --- a/lib/python/qmk/tests/attrdict.py +++ b/lib/python/qmk/tests/attrdict.py @@ -3,6 +3,7 @@ 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 -- cgit v1.2.3 From 79edb7c5942108774e667c172550a1519c5543ac Mon Sep 17 00:00:00 2001 From: skullY Date: Tue, 12 Nov 2019 17:27:08 -0800 Subject: Small CLI cleanups * yapf changes * Fix the cformat test * Make the normpath test work when run from / * `qmk config`: Mark `--read-only` as arg_only --- lib/python/qmk/tests/attrdict.py | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/python/qmk/tests/attrdict.py') 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 -- cgit v1.2.3