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).
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
andunicode_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 whereto_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 byto_US_keystrokes
and then given the context object in a new call, finally getting the combo list returned by the inner function ofunicode_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