-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UITester DirectoryEditor support (#1710)
* add simple support of directory editor using register_editable_textbox_handlers * same for wx and add DirectoryEditor to default registry * add modified versions of FileEditor Tests for DirectoryEditor * add news fragment * remove unused imports
- Loading branch information
1 parent
347f0b5
commit 60d7ef0
Showing
6 changed files
with
120 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add UITester DirectoryEditor support (#1710) |
32 changes: 32 additions & 0 deletions
32
traitsui/testing/tester/_ui_tester_registry/qt4/_traitsui/directory_editor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# (C) Copyright 2004-2021 Enthought, Inc., Austin, TX | ||
# All rights reserved. | ||
# | ||
# This software is provided without warranty under the terms of the BSD | ||
# license included in LICENSE.txt and may be redistributed only under | ||
# the conditions described in the aforementioned license. The license | ||
# is also available online at http://www.enthought.com/licenses/BSD.txt | ||
# | ||
# Thanks for using Enthought open source! | ||
|
||
from traitsui.testing.tester._ui_tester_registry.qt4._registry_helper import ( | ||
register_editable_textbox_handlers, | ||
) | ||
from traitsui.qt4.directory_editor import SimpleEditor | ||
|
||
|
||
def register(registry): | ||
""" Register interactions for the given registry. | ||
If there are any conflicts, an error will occur. | ||
Parameters | ||
---------- | ||
registry : TargetRegistry | ||
The registry being registered to. | ||
""" | ||
|
||
register_editable_textbox_handlers( | ||
registry=registry, | ||
target_class=SimpleEditor, | ||
widget_getter=lambda wrapper: wrapper._target._file_name, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
traitsui/testing/tester/_ui_tester_registry/wx/_traitsui/directory_editor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# (C) Copyright 2004-2021 Enthought, Inc., Austin, TX | ||
# All rights reserved. | ||
# | ||
# This software is provided without warranty under the terms of the BSD | ||
# license included in LICENSE.txt and may be redistributed only under | ||
# the conditions described in the aforementioned license. The license | ||
# is also available online at http://www.enthought.com/licenses/BSD.txt | ||
# | ||
# Thanks for using Enthought open source! | ||
|
||
from traitsui.wx.directory_editor import SimpleEditor | ||
from traitsui.testing.tester._ui_tester_registry.wx._registry_helper import ( | ||
register_editable_textbox_handlers, | ||
) | ||
|
||
|
||
def register(registry): | ||
""" Register interactions for the given registry. | ||
If there are any conflicts, an error will occur. | ||
Parameters | ||
---------- | ||
registry : TargetRegistry | ||
The registry being registered to. | ||
""" | ||
register_editable_textbox_handlers( | ||
registry=registry, | ||
target_class=SimpleEditor, | ||
widget_getter=lambda wrapper: wrapper._target._file_name, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters