def outlineexplorer(qtbot): """Set up an OutlineExplorerWidget.""" outlineexplorer = OutlineExplorerWidget(None, None, None) outlineexplorer.set_conf('show_fullpath', False) outlineexplorer.set_conf('show_all_files', True) outlineexplorer.set_conf('group_cells', True) outlineexplorer.set_conf('show_comments', True) outlineexplorer.set_conf('sort_files_alphabetically', False) outlineexplorer.set_conf('display_variables', True) # Fix the size of the outline explorer to prevent an # 'Unable to set geometry ' warning if the test fails. outlineexplorer.setFixedSize(400, 350) qtbot.addWidget(outlineexplorer) outlineexplorer.show() return outlineexplorer
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) plugin_mock = MagicMock() plugin_mock.NAME = 'outline_explorer' outlineexplorer = OutlineExplorerWidget('outline_explorer', plugin_mock, None) outlineexplorer.setup() outlineexplorer.set_conf('show_fullpath', True) outlineexplorer.set_conf('show_comments', True) outlineexplorer.set_conf('group_cells', True) outlineexplorer.set_conf('display_variables', True) outlineexplorer.set_conf('follow_cursor', follow_cursor) 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