Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests and fixes for get/set max rgb value behaviour #99

Merged
merged 5 commits into from
Nov 10, 2024

Conversation

robberwick
Copy link
Collaborator

This pull request introduces several updates to the BlinkStick class, including type annotations, improved bounds checking, and additional tests to ensure the functionality of new and existing features. The most important changes are:

Enhancements to BlinkStick class:

  • Added type annotations to the max_rgb_value attribute and relevant methods in src/blinkstick/blinkstick.py. [1] [2]
  • Implemented bounds checking and type coercion in the set_max_rgb_value method.

Improvements in testing:

  • Refactored existing tests to use a new fixture make_blinkstick for creating BlinkStick instances, ensuring consistency and reducing code duplication. [1] [2]
  • Removed redundant tests from tests/test_blinkstick.py after refactoring.

move tests around
update the get_color tests to use the blinkstick fixture
make the blinkstick fixture return a callable that will make a blinkstick, so that we can use it to creat multiple instances in the same test.
Add tests for max_rgb_value to ensure:

* that it is per-instance and not class based
* that it performs bounds checking when setting
* that it performs type checking and coercion when setting
@robberwick robberwick merged commit 5896dcb into arvydas:release/2.0-dev Nov 10, 2024
15 checks passed
@robberwick robberwick deleted the per-instance-max-rgb branch November 10, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant