def test_shortcut_in_conf_is_filtered_with_shortcut_data(qtbot): shortcut_table = ShortcutsTable() shortcut_table = load_shortcuts(shortcut_table) qtbot.addWidget(shortcut_table) row_count = shortcut_table.model().rowCount() assert row_count != 0 shortcut_table_empty = ShortcutsTable() shortcut_table_empty.set_shortcut_data([ (None, '_', 'switch to plots', None, None), (None, '_', 'switch to editor', None, None), ]) shortcut_table_empty.load_shortcuts() qtbot.addWidget(shortcut_table_empty) row_count = shortcut_table_empty.model().rowCount() assert row_count == 2
def shortcut_table(qtbot): """Set up shortcuts.""" shortcut_table = ShortcutsTable() shortcut_table = load_shortcuts(shortcut_table) qtbot.addWidget(shortcut_table) return shortcut_table
def setup_shorcuts(qtbot): """Set up shortcuts.""" widget = ShortcutsTable() qtbot.addWidget(widget) return widget