-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make EventLoopHelper expect an IGUI instance (#953)
* add a failing test * make gui trait an Instance(IGUI) * Update pyface/ui/qt4/util/tests/test_event_loop_helper.py Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com> Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
- Loading branch information
1 parent
87c54c8
commit b4152da
Showing
2 changed files
with
30 additions
and
2 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
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,28 @@ | ||
# Copyright (c) 2005-2021, Enthought Inc. | ||
# 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! | ||
import unittest | ||
|
||
from traits.api import HasTraits, provides | ||
|
||
from pyface.i_gui import IGUI | ||
from pyface.ui.qt4.util.event_loop_helper import EventLoopHelper | ||
|
||
|
||
@provides(IGUI) | ||
class DummyGUI(HasTraits): | ||
pass | ||
|
||
|
||
class TestEventLoopHelper(unittest.TestCase): | ||
|
||
def test_gui_trait_expects_IGUI_interface(self): | ||
# Trivial test where we simply set the trait | ||
# and the test passes because no errors are raised. | ||
event_loop_helper = EventLoopHelper() | ||
event_loop_helper.gui = DummyGUI() |