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

Update test_api_helpers.py for new processor functions #146

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RedBearAK
Copy link
Contributor

This updates test_api_helpers.py to allow it to function after the string and Unicode processor functions are updated to return inner functions, so that they can adjust to the state of the CapsLock LED.

Changes

Add two context object classes, so that the behavior of to_US_keystrokes and unicode_keystrokes can be evaluated after they are turned into functions that return functions (that return lists). In the simple case, the function can just have (ctx) added on the end. In the case where to_US_keystrokes is given a non-ASCII character to process, it returns a list with the Unicode inner function inside, so that needs to be extracted from the list returned by to_US_keystrokes and then given the context object in a new call, finally getting the combo list returned by the inner function of unicode_keystrokes.

One context object class is for the normal state of CapsLock OFF, the other is for testing the behavior when CapsLock is ON. Some test conditions have been added to test the CapsLock ON behavior.

All tests are passing for me.

Related to issue #128, and pull request #129 (which will close issue #128).

Checklist

  • Added tests (if necessary)

This updates test_api_helpers.py to allow it to function after the string and Unicode processor functions are updated to return inner functions, so that they can adjust to the state of the CapsLock LED.
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