/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_notify.py

  • Committer: Curtis Hovey
  • Date: 2012-02-03 19:49:55 UTC
  • mto: This revision was merged to the branch mainline in revision 773.
  • Revision ID: sinzui.is@verizon.net-20120203194955-69jvr0mgu8igea0i
Updated bzr-notify to gtk3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
 
from gi.repository import Gtk
 
18
import os
 
19
import subprocess
19
20
 
20
21
from bzrlib import tests
21
22
from bzrlib.plugins.gtk.notify import NotifyPopupMenu
26
27
    SHOW_WIDGETS = False
27
28
 
28
29
 
29
 
# ['_Gateway to LAN', '', 'Announce _branches on LAN', '', 'gtk-preferences', 'gtk-about', '', 'gtk-quit']
30
 
 
31
30
class NotifyPopupMenuTestCase(tests.TestCase):
32
31
 
33
32
    def test_init(self):
39
38
        self.assertEqual('gtk-preferences', items[4].props.label)
40
39
        self.assertEqual('gtk-about', items[5].props.label)
41
40
        self.assertEqual('gtk-quit', items[7].props.label)
 
41
 
 
42
 
 
43
class BzrNotifyTestCase(tests.TestCase):
 
44
 
 
45
    def test_smoketest(self):
 
46
        # This is a smoke test to verify the process starts.
 
47
        # The logic of the module must be moved into notify.py
 
48
        # where it can be properly tested.
 
49
        script = os.path.join(
 
50
            os.path.dirname(__file__), os.pardir, 'bzr-notify')
 
51
        bzr_notify = subprocess.Popen(
 
52
            [script, 'test'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
53
        stdout, stderr = bzr_notify.communicate()
 
54
        self.assertEqual('', stdout)
 
55
        self.assertEqual('', stderr)