rewrite_key_event_test.py 756 B

1234567891011121314151617181920212223
  1. import pytest
  2. from Xlib import XK
  3. from rescriptoon._actions import RewriteKeyEventAction
  4. @pytest.mark.parametrize(
  5. ("keysym", "target_engine_index", "description"),
  6. [
  7. (None, None, "forward to all engines"),
  8. (None, 0, "forward to engine #0"),
  9. (None, 1, "forward to engine #1"),
  10. # pylint: disable=no-member; false positive
  11. (XK.XK_Up, None, "send ↑ to all engines"),
  12. (XK.XK_Delete, 0, "send delete to engine #0"),
  13. (XK.XK_Control_L, 1, "send left ctrl to engine #1"),
  14. ],
  15. )
  16. def test_description(keysym, target_engine_index, description):
  17. action = RewriteKeyEventAction(
  18. keysym=keysym, target_engine_index=target_engine_index
  19. )
  20. assert action.description == description