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 for string to bytes conversion and refactor #108

Merged
merged 3 commits into from
Nov 17, 2024

Conversation

robberwick
Copy link
Collaborator

This pull request includes several changes to the blinkstick package, focusing on refactoring code and adding new utility functions and tests. The most important changes involve moving a helper method to a utility module and updating the code to use this new method.

Refactoring and code improvements:

Testing:

  • tests/utilities/test_string_to_info_block.py: Added tests for the string_to_info_block_data function to ensure it correctly converts strings to byte arrays, handles empty strings, truncates long strings, and processes strings with exactly 31 characters.

make `_data_to_message` a standalone function, move it to a `utilities` package, and rename
* restrict info block data string to 31 bytes
* correctly handle empty string
@robberwick robberwick merged commit 20be82b into arvydas:release/2.0-dev Nov 17, 2024
17 checks passed
@robberwick robberwick deleted the _data_to_message branch November 17, 2024 17:14
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