def setUp(self): self.command_stack = CommandStack() self.command_stack.push = MagicMock() self.component = Component(position=[50, 50], bounds=[100, 100]) self.container = Container() self.container.add(self.component) self.tool = ResizeCommandTool(component=self.component, command_stack=self.command_stack) self.component.tools.append(self.tool)
def setUp(self): # set up Enable components and tools self.container = Container(postion=[0, 0], bounds=[600, 600]) self.tool = MouseEventTool(component=self.container) self.container.tools.append(self.tool) # set up qt components self.window = Window(None, size=(600, 600), component=self.container) # Hack: event processing code skips if window not actually shown by # testing for value of _size self.window._size = (600, 600)
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)