Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fsleyes
fsleyes-widgets
Commits
cdc31116
Commit
cdc31116
authored
Apr 28, 2017
by
Paul McCarthy
Browse files
Another atc test.
parent
ca6b60fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_autotextctrl.py
View file @
cdc31116
...
...
@@ -36,6 +36,31 @@ def _test_AutoTextCtrl_getSet():
assert
atc
.
GetValue
()
==
'b'
def
test_AutoTextCtrl_event
():
run_with_wx
(
_test_AutoTextCtrl_event
)
def
_test_AutoTextCtrl_event
():
called
=
[
None
]
def
handler
(
ev
):
called
[
0
]
=
ev
.
text
sim
=
wx
.
UIActionSimulator
()
parent
=
wx
.
GetApp
().
GetTopWindow
()
atc
=
autott
.
AutoTextCtrl
(
parent
)
atc
.
Bind
(
autott
.
EVT_ATC_TEXT_ENTER
,
handler
)
atc
.
SetFocus
()
sim
.
Char
(
ord
(
'a'
))
sim
.
Char
(
ord
(
'b'
))
sim
.
Char
(
ord
(
'c'
))
sim
.
KeyDown
(
wx
.
WXK_RETURN
)
wx
.
Yield
()
assert
atc
.
GetValue
()
==
'abc'
assert
called
[
0
]
==
'abc'
# Make sure that when the cotrol receives
# focus, its insertion point is at the end
def
test_AutoTextCtrl_onFocus
():
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment