Ejemplo n.º 1
0
def test_get_menu_without_menubar_2():
    class MB:
        def addMenu(self, text):
            return 'menu'

    parent = Mock(menubar=MB())
    plugin = Plugin(parent)
    assert plugin.getMenu('file') == 'menu'
Ejemplo n.º 2
0
def test_get_menu_without_menubar():
    parent = Mock(menubar=None)
    plugin = Plugin(parent)
    plugin._menu_map['file'] = 'menu'
    assert plugin.getMenu('file') == 'menu'
Ejemplo n.º 3
0
def test_get_menu_with_menubar():
    parent = MagicMock()
    parent.menubar.menus = {'file': 'menu'}
    plugin = Plugin(parent)
    assert plugin.getMenu('file') == 'menu'