Esempio n. 1
0
    def setUp(self):
        from pyface.qt.QtGui import QApplication
        from pyface.ui.qt4.util.event_loop_helper import EventLoopHelper

        qt_app = QApplication.instance()
        if qt_app is None:
            qt_app = QApplication([])
        self.qt_app = qt_app

        if NativeScrollBar is None:
            raise unittest.SkipTest("Qt4 NativeScrollbar not available.")
        self.gui = GUI()
        self.event_loop_helper = EventLoopHelper(gui=self.gui, qt_app=qt_app)
        self.container = Container(position=[0, 0], bounds=[600, 600])
        self.window = Window(None, size=(600, 600), component=self.container)
Esempio n. 2
0
from traits.testing.unittest_tools import unittest
from traits.api import Str
from traits.etsconfig.api import ETSConfig

if ETSConfig.toolkit not in ['', 'qt4']:
    raise unittest.SkipTest("TestEnamlEditor: Enaml does not support WX")

from traits_enaml.testing.gui_test_assistant import GuiTestAssistant
from enaml.widgets.api import Label


from pyface.tasks.api import EnamlEditor


class DummyStrEditor(EnamlEditor):

    obj = Str

    def create_component(self):
        return Label(text=self.obj)


class TestEnamlEditor(GuiTestAssistant, unittest.TestCase):

    ###########################################################################
    # 'TestCase' interface
    ###########################################################################

    def setUp(self):
        GuiTestAssistant.setUp(self)
        self.obj = 'test message'
Esempio n. 3
0
from traits.testing.unittest_tools import unittest
from traits.etsconfig.api import ETSConfig

if ETSConfig.toolkit not in ['', 'qt4']:
    raise unittest.SkipTest("TestEnamlDockPane: Enaml does not support WX")

try:
    from enaml.widgets.api import Label
    from traits_enaml.testing.gui_test_assistant import GuiTestAssistant
except ImportError:
    raise unittest.SkipTest("Enaml not installed")

from pyface.tasks.api import EnamlDockPane, Task


class DummyDockPane(EnamlDockPane):
    def create_component(self):
        return Label(text='test label')


class TestEnamlDockPane(GuiTestAssistant, unittest.TestCase):

    ###########################################################################
    # 'TestCase' interface
    ###########################################################################

    def setUp(self):
        GuiTestAssistant.setUp(self)
        self.dock_pane = DummyDockPane(task=Task(id='dummy_task'))
        with self.event_loop():
            self.dock_pane.create(None)
from traits.testing.unittest_tools import unittest
from traits.etsconfig.api import ETSConfig

if ETSConfig.toolkit not in ['', 'qt4']:
    raise unittest.SkipTest("TestEnamlDockPane: Enaml does not support WX")

from traits_enaml.testing.gui_test_assistant import GuiTestAssistant
from enaml.widgets.api import Label

from pyface.tasks.api import EnamlDockPane, Task


class DummyDockPane(EnamlDockPane):
    def create_component(self):
        return Label(text='test label')


class TestEnamlDockPane(GuiTestAssistant, unittest.TestCase):

    ###########################################################################
    # 'TestCase' interface
    ###########################################################################

    def setUp(self):
        GuiTestAssistant.setUp(self)
        self.dock_pane = DummyDockPane(task=Task(id='dummy_task'))
        with self.event_loop():
            self.dock_pane.create(None)

    def tearDown(self):
        if self.dock_pane.control is not None:
Esempio n. 5
0
from traits.testing.unittest_tools import unittest
from traits.etsconfig.api import ETSConfig

if ETSConfig.toolkit not in ['', 'qt4']:
    raise unittest.SkipTest("TestEnamlEditor: Enaml does not support WX")

try:
    from enaml.widgets.api import Label
    from traits_enaml.testing.gui_test_assistant import GuiTestAssistant
except ImportError:
    raise unittest.SkipTest("Enaml not installed")

from traits.api import Str
from pyface.tasks.api import EnamlEditor


class DummyStrEditor(EnamlEditor):

    obj = Str

    def create_component(self):
        return Label(text=self.obj)


class TestEnamlEditor(GuiTestAssistant, unittest.TestCase):

    ###########################################################################
    # 'TestCase' interface
    ###########################################################################

    def setUp(self):