Пример #1
0
def test_on_show_window(update_menubar_mock):
    parent = MagicMock()
    plugin = Plugin(parent)
    window = MagicMock()

    plugin.onShowWindow(window)

    window.showNormal.assert_called_once()
    window.activateWindow.assert_called_once()
    window.raise_.assert_called_once()
    update_menubar_mock.assert_called_once()
Пример #2
0
def test_get_menu_with_menubar():
    parent = MagicMock()
    parent.menubar.menus = {'file': 'menu'}
    plugin = Plugin(parent)
    assert plugin.getMenu('file') == 'menu'