test_backend_tools.py 501 B

1234567891011121314151617181920
  1. import pytest
  2. from matplotlib.backend_tools import ToolHelpBase
  3. @pytest.mark.parametrize('rc_shortcut,expected', [
  4. ('home', 'Home'),
  5. ('backspace', 'Backspace'),
  6. ('f1', 'F1'),
  7. ('ctrl+a', 'Ctrl+A'),
  8. ('ctrl+A', 'Ctrl+Shift+A'),
  9. ('a', 'a'),
  10. ('A', 'A'),
  11. ('ctrl+shift+f1', 'Ctrl+Shift+F1'),
  12. ('1', '1'),
  13. ('cmd+p', 'Cmd+P'),
  14. ('cmd+1', 'Cmd+1'),
  15. ])
  16. def test_format_shortcut(rc_shortcut, expected):
  17. assert ToolHelpBase.format_shortcut(rc_shortcut) == expected