예제 #1
0
def setup_terminal(qtbot_module, request):
    """Set up the Notebook plugin."""
    class MainMock(QMainWindow):
        def __getattr__(self, attr):
            return Mock()

        def register_shortcut(self, *args, **kwargs):
            pass

    main = MainMock()
    CONF.register_plugin(TerminalPlugin)
    terminal = TerminalPlugin(main, CONF)
    terminal.update_font()
    qtbot_module.addWidget(terminal)
    qtbot_module.waitUntil(lambda: terminal.get_widget().server_is_ready(),
                           timeout=TERM_UP)
    qtbot_module.wait(5000)
    terminal.create_new_term()
    terminal.get_widget().show()

    def teardown():
        terminal.on_close()

    request.addfinalizer(teardown)
    return terminal
예제 #2
0
def setup_terminal(qtbot):
    """Set up the Notebook plugin."""
    terminal = TerminalPlugin(None)
    qtbot.addWidget(terminal)
    terminal.create_new_term()
    terminal.show()
    return terminal
예제 #3
0
def setup_terminal(qtbot_module, request):
    """Set up the Notebook plugin."""
    terminal = TerminalPlugin(None)
    qtbot_module.addWidget(terminal)
    qtbot_module.waitUntil(lambda: terminal.server_is_ready(), timeout=TERM_UP)
    qtbot_module.wait(5000)
    terminal.create_new_term()
    terminal.show()

    def teardown():
        terminal.closing_plugin()

    request.addfinalizer(teardown)
    return terminal