1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2012 Curtis C. Hovey <sinzui.is@verizon.net>
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
from gi.repository import Gtk
20
from bzrlib import tests
21
from bzrlib.plugins.gtk.notify import NotifyPopupMenu
24
class FakeNotifyPopupMenu(NotifyPopupMenu):
29
# ['_Gateway to LAN', '', 'Announce _branches on LAN', '', 'gtk-preferences', 'gtk-about', '', 'gtk-quit']
31
class NotifyPopupMenuTestCase(tests.TestCase):
34
menu = FakeNotifyPopupMenu()
35
items = menu.get_children()
36
self.assertEqual(8, len(items))
37
self.assertEqual('_Gateway to LAN', items[0].props.label)
38
self.assertEqual('Announce _branches on LAN', items[2].props.label)
39
self.assertEqual('gtk-preferences', items[4].props.label)
40
self.assertEqual('gtk-about', items[5].props.label)
41
self.assertEqual('gtk-quit', items[7].props.label)