Skip to content

fix UITester wx - explicitly handle a KeyClick('Backspace') and update key_click_text_ctrl#1184

Merged
aaronayres35 merged 12 commits intomasterfrom
fix-backspace-UITester-wx
Sep 3, 2020
Merged

fix UITester wx - explicitly handle a KeyClick('Backspace') and update key_click_text_ctrl#1184
aaronayres35 merged 12 commits intomasterfrom
fix-backspace-UITester-wx

Conversation

@aaronayres35
Copy link
Contributor

@aaronayres35 aaronayres35 commented Sep 2, 2020

fixes #1183
fixes #1182
fixes #1177
This PR explicitly handles the case when a KeyClick command is issued with "Backspace" as the key. It also makes the same change that was added in PR #1181 for key_sequence_text_ctrl to key_click_text_ctrl
Finally, it makes the default behavior for entering a textbox to have the insertion point be the rightmost rather than the leftmost point of text. (this keeps consistent behavior with qt)

@aaronayres35 aaronayres35 changed the title explicitly handle a KeyClick('Backspace') fix UITester wx - explicitly handle a KeyClick('Backspace') Sep 2, 2020
@aaronayres35 aaronayres35 changed the title fix UITester wx - explicitly handle a KeyClick('Backspace') fix UITester wx - explicitly handle a KeyClick('Backspace') and update key_click_text_ctrl Sep 2, 2020
@aaronayres35 aaronayres35 marked this pull request as ready for review September 2, 2020 15:30
@aaronayres35 aaronayres35 requested a review from kitchoi September 2, 2020 15:30
@aaronayres35 aaronayres35 requested a review from kitchoi September 3, 2020 14:20
Copy link
Contributor

@kitchoi kitchoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM.
(This time let's make sure the wx + Windows build is happy with the tests on RangeEditor and TextCtrl 🤞 )

@aaronayres35
Copy link
Contributor Author

Code LGTM.
(This time let's make sure the wx + Windows build is happy with the tests on RangeEditor and TextCtrl 🤞 )

Damn, there was one test failure on windows:

======================================================================
901FAIL: test_range_text_editor_set_with_text_valid (traitsui.tests.editors.test_range_editor.TestRangeEditor)
902----------------------------------------------------------------------
903Traceback (most recent call last):
904  File "C:\Users\appveyor\.edm\envs\traitsui-test-3.6-wx\lib\site-packages\traitsui\tests\editors\test_range_editor.py", line 83, in test_range_text_editor_set_with_text_valid
905    return self.check_set_with_text_valid(mode='text')
906  File "C:\Users\appveyor\.edm\envs\traitsui-test-3.6-wx\lib\site-packages\traitsui\tests\editors\test_range_editor.py", line 70, in check_set_with_text_valid
907    self.assertEqual(model.value, 10)
908AssertionError: 1 != 10
909
910----------------------------------------------------------------------
911

Will try to fix this now before merging

Copy link
Contributor

@kitchoi kitchoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still LGTM.

Last but not least...new flake8 errors
$ flake8 traitsui/tests/editors/test_range_editor.py 
traitsui/tests/editors/test_range_editor.py:16:1: E302 expected 2 blank lines, found 1
traitsui/tests/editors/test_range_editor.py:70:47: E225 missing whitespace around operator
traitsui/tests/editors/test_range_editor.py:73:71: W291 trailing whitespace
traitsui/tests/editors/test_range_editor.py:124:52: W291 trailing whitespace
traitsui/tests/editors/test_range_editor.py:128:1: W391 blank line at end of file

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.

KeyClick + TextCtrl test failure on Wx and Windows Test failures on RangeEditor with Wx and Windows Test failures on TextEditor for Wx on Windows

2 participants