MattHag
691e5878f9
Remove obsolete pytest fixture
2024-10-11 07:42:38 -04:00
MattHag
1f85ec01e7
base: Add more unit tests
...
Make internal functions private.
2024-10-11 07:42:38 -04:00
MattHag
46366b2430
Fix warnings from automatic code inspections
...
Warnings found by automatic code inspection and partially tackled
- Drop distuitls inf favour of setuptools
- Replace deprecated pyudev.Device.from_device_number
- Remove unnecessary brackets
- Avoid access to private variables etc.
- Shadows built-in name
- Line length >120 characters
- Not a module level variable
- Simplify clause
and more
2024-10-11 07:42:38 -04:00
MattHag
0f4d1aebcd
ui/common: Introduce tests
2024-10-11 07:42:38 -04:00
MattHag
89233957dc
settings: Add tests
2024-10-11 07:42:38 -04:00
MattHag
cba3533869
Remove factory wrapper classes
...
A module level function is sufficient, no wrapper needed.
2024-10-11 07:42:38 -04:00
MattHag
ef6b7dec2c
receiver: Remove hard dependency on base
...
With this test all receiver tests are macOS compatible again. The low
level interface supports passing a fake API for unit tests.
2024-10-11 07:42:38 -04:00
MattHag
37e2ac80ba
base: Add test for filter_products_of_interest
2024-10-11 07:42:38 -04:00
MattHag
1729189981
base: Add find_paired_node functions
...
Avoid direct access to hidapi and use the base module as low-level API
instead. This change replaces the remaining calls to find_paired_node
and find_paired_node_wpid by exposing them via base module.
2024-10-11 07:42:38 -04:00
MattHag
8d0672ac3c
base_usb: Add external interface
...
Clean up, type hint and tests base_usb and related modules.
2024-10-11 07:42:38 -04:00
MattHag
a75c4b9679
ui/about: Use Model-View-Presenter pattern for testability
...
Split model and view, and enable view mocks for unit tests without GDK.
2024-10-11 07:42:38 -04:00
MattHag
46fafa0e68
hidapi: Explicitly load hidapi/udev implementation
...
Linux uses udev, other platforms use the cross-platform hidapi
implementation. Remove implicit loading of hidapi in hidapi/__init__.py.
2024-10-11 07:42:38 -04:00
MattHag
99fc9c6fcb
receiver: Remove hard dependency on hidapi
2024-10-11 07:42:38 -04:00
MattHag
615499dce2
device: Remove hard dependency on hidapi
2024-10-11 07:42:38 -04:00
MattHag
65d3b406c0
keysyms: Introduce tests for this package
2024-10-11 07:42:38 -04:00
MattHag
aa354dc4c4
Replace global sw_id with function call
...
Add test for it.
2024-10-08 14:35:16 -04:00
MattHag
2442299539
base: Simplify receiver info retrieval
...
- Remove comments with unused receivers
- Simplify receiver hardcoded info
2024-10-08 14:35:16 -04:00
MattHag
d5af19be8a
Make ui/desktop_notifications testable
...
Introduce unit tests.
Related #2273
2024-10-08 14:35:16 -04:00
MattHag
912afff173
Make lr/desktop_notifications testable
...
Introduce unit tests.
Related #2273
2024-10-08 14:35:16 -04:00
MattHag
741c0861c2
Clarify that fake hidpp is used
...
This module shouldn't be necessary on the long run. Remove pieces from
it whenever possible.
2024-10-08 14:35:16 -04:00
MattHag
40033c0183
Introduce hid_parser tests
...
Add basic tests to cover the package.
2024-09-15 09:19:13 -04:00
MattHag
70def31942
Refactor: Distinguish module from package
...
Adapt module names to easily distinguish them.
Related #2480
2024-09-15 09:18:51 -04:00
MattHag
be83dac209
hid: Convert definition of HID registers to enum
...
* Refactor HID Register definitions
Use enums for distinct type hints, easy discovery of registers.
Make constants uppercase and benefit from enum auto-completion.
Related #2273
* Improve type hints: Registers
2024-06-02 10:34:00 -04:00
MattHag
244d0ee88a
solaar: clean up locale code
...
Usage example for German:
LC_ALL=de_DE.UTF-8 solaar
Related #2507
2024-06-01 12:09:55 -04:00
MattHag
c29231bc6b
refactor: Creation of devices ( #2493 )
...
* Refine interfaces for testability
* Reenable fixed device tests
2024-05-27 11:58:16 -04:00
Peter F. Patel-Schneider
90b0db6c3b
device: don't ping device when getting name or codename
2024-05-22 21:22:08 -04:00
Matthias Hagmann
c9dc232951
Refactor: Use dataclasses and enums
...
Replace unnecessary NamedInts in favour of default data types.
Simplify interfaces by reducing possible input from strings to members
of an enum.
2024-05-22 21:14:41 -04:00
Matthias Hagmann
193dbfda21
hidpp10: Move independent functions to module level
2024-05-22 21:14:41 -04:00
MattHag
500b9998c5
Fix macOS compatibility and reenable CI tests
...
* Fix CI for macOS
* Fix error message for missing hidapi
* Skip some device and receiver tests on macOS
Tests fail on macOS, enable them when unit tests are
refined to only test the module without dependencies.
* Safe guard dbus import
2024-05-22 18:45:40 -04:00
MattHag
20d34025d8
diversion: Add unit tests
2024-05-05 10:43:39 -04:00
Peter F. Patel-Schneider
3ffa4e30f1
settings: get and use current host number for K375sFnSwap because of bug in firmware of MX Keys S
2024-05-04 04:46:27 -04:00
Peter F. Patel-Schneider
da1cb53c1b
settings: optimize write for per-key lighting
2024-05-03 11:54:24 -04:00
Peter F. Patel-Schneider
e5967edc66
settings: add and initialize per-key lighting to a special no-change value
2024-05-03 11:54:24 -04:00
MattHag
959dd2a35b
Refactor rule loading for testability ( #2456 )
...
rules: Introduce tests for YAML rule loading functionality.
2024-04-27 17:56:27 -04:00
Peter F. Patel-Schneider
c4e2a5683a
device: initialize device registers to empty list
2024-04-19 16:05:29 -04:00
Peter F. Patel-Schneider
e667d41c7b
solaar: use bluez dbus signals to disconnect and connect bluetooth devices
2024-04-18 20:32:40 -04:00
Peter F. Patel-Schneider
d7ce636917
device: handle a different signal for onboard profiles directory in ROM
2024-04-15 14:40:50 -04:00
Peter F. Patel-Schneider
1eb1d4b198
tests: extend tests for device.py
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
c7195881e3
tests: expand tests for device.py
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
9bb2a1ff5c
tests: expand tests for settings_templates
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
c7a2f1698b
tests: extend testing of hidpp20
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
c283da27df
tests: extend testing of hidpp20
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
6c67789bad
tests: extend device testing
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
d12575b47d
tests: test GESTURES settings
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
e64eec18e9
tests: extend testing of hidpp20
2024-04-13 18:38:44 -04:00
Peter F. Patel-Schneider
b43cdace79
tests: expand tests for settings_templates
2024-04-09 10:31:06 -04:00
Peter F. Patel-Schneider
8de3a1d2e2
device: better support for extended ajustable dpi
2024-04-09 10:31:06 -04:00
Peter F. Patel-Schneider
c70e8b54bf
tests: remove unused code
2024-03-27 18:02:55 -04:00
Peter F. Patel-Schneider
12f3f2e856
tests: adjust imports to always import installed version
2024-03-27 18:02:55 -04:00
Peter F. Patel-Schneider
cb16a46b93
tests: test more settings
2024-03-27 11:15:15 -04:00