Ejemplo n.º 1
0
def setup_outline_explorer(qtbot):
    """Set up outline_explorer."""
    oew = OutlineExplorerWidget(None)
    qtbot.addWidget(oew)

    oe_proxy = OutlineExplorerProxyTest('test.py', oe_data)
    oew.set_current_editor(oe_proxy, update=True, clear=False)

    return oew, oe_proxy
Ejemplo n.º 2
0
def setup_outline_explorer(qtbot):
    """Set up outline_explorer."""
    oew = OutlineExplorerWidget(None)
    qtbot.addWidget(oew)

    oe_proxy = OutlineExplorerProxyTest('test.py', oe_data)
    oew.set_current_editor(oe_proxy, update=True, clear=False)

    return oew, oe_proxy
Ejemplo n.º 3
0
    def _create_outlineexplorer(code, filename, follow_cursor=False):
        code_editor = CodeEditor(None)
        code_editor.set_language('py', filename)
        code_editor.set_text(code)

        editor = OutlineExplorerProxyEditor(code_editor, filename)

        outlineexplorer = OutlineExplorerWidget(follow_cursor=follow_cursor)
        outlineexplorer.set_current_editor(editor, False, False)
        outlineexplorer.show()
        outlineexplorer.setFixedSize(400, 350)

        qtbot.addWidget(outlineexplorer)
        return outlineexplorer
Ejemplo n.º 4
0
def editor_outline_explorer_bot():
    """setup editor and outline_explorer."""
    app = qapplication()
    editor = CodeEditor(parent=None)
    editor.setup_editor(language='Python')
    outlineexplorer = OutlineExplorerWidget(editor)

    editor.set_text(text)

    editor.oe_proxy = OutlineExplorerProxyEditor(editor, "test.py")
    outlineexplorer.set_current_editor(editor.oe_proxy,
                                       update=False,
                                       clear=False)
    outlineexplorer.setEnabled(True)

    return editor, outlineexplorer, editor.oe_proxy
def editor_outline_explorer_bot():
    """setup editor and outline_explorer."""
    app = qapplication()
    editor = CodeEditor(parent=None)
    editor.setup_editor(language='Python')
    outlineexplorer = OutlineExplorerWidget(editor)

    editor.set_text(text)

    editor.oe_proxy = OutlineExplorerProxyEditor(editor, "test.py")
    outlineexplorer.set_current_editor(editor.oe_proxy,
                                       update=False,
                                       clear=False)
    outlineexplorer.setEnabled(True)

    return editor, outlineexplorer, editor.oe_proxy
Ejemplo n.º 6
0
        symbol_info = json.load(open(case_info['data'], 'r'))
        expected_tree = json.load(open(case_info['tree'], 'r'))

        code_editor = CodeEditor(None)
        code_editor.set_language('py', filename)
        code_editor.set_text(text)

        editor = OutlineExplorerProxyEditor(code_editor, filename)

        outlineexplorer = OutlineExplorerWidget(follow_cursor=follow_cursor,
                                                display_variables=True,
                                                group_cells=True,
                                                show_comments=True)
        outlineexplorer.register_editor(editor)
        outlineexplorer.set_current_editor(editor, False, False)
        outlineexplorer.show()
        outlineexplorer.setFixedSize(400, 350)

        editor.update_outline_info(symbol_info)
        qtbot.addWidget(outlineexplorer)
        return outlineexplorer, expected_tree
    return _create_outlineexplorer


# ---- Test OutlineExplorerWidget
@pytest.mark.parametrize('case', AVAILABLE_CASES)
def test_outline_explorer(case, create_outlineexplorer):
    """
    Test to assert the outline explorer is initializing correctly and
    is showing the expected number of items, the expected type of items, and