~ubuntuone-control-tower/ubuntuone-client/stable-13-10

« back to all changes in this revision

Viewing changes to tests/platform/notification/test_linux.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2013-01-28 23:09:36 UTC
  • mfrom: (1378.1.5 no-pygtk)
  • Revision ID: tarmac-20130128230936-1k8aksvh4vlyzyi5
Remove most of the remaining support for older static glib bindings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# tests.platform.linux.test_notification
2
 
#
3
 
# Author: Eric Casteleijn <eric.casteleijn@canonical.com>
4
 
#
5
 
# Copyright 2010-2012 Canonical Ltd.
 
1
# Copyright 2010-2013 Canonical Ltd.
6
2
#
7
3
# This program is free software: you can redistribute it and/or modify it
8
4
# under the terms of the GNU General Public License version 3, as published
33
29
least they ensure 100% coverage and hence no silly/syntax errors.
34
30
"""
35
31
 
36
 
import sys
37
 
 
38
32
from mocker import Mocker
39
33
from twisted.internet import defer
40
34
from twisted.trial.unittest import TestCase
72
66
 
73
67
    def _set_up_mock_notify(self, title, message, icon):
74
68
        """Set up the mock_notify expectations."""
75
 
        if 'gobject' in sys.modules and sys.modules['gobject'] is not None:
76
 
            mock_notify = self.mocker.replace("pynotify")
77
 
            mock_notify.init(FAKE_APP_NAME)
78
 
            mock_notify.Notification(title, message, icon)
79
 
        else:
80
 
            mock_notify = self.mocker.replace('gi.repository.Notify')
81
 
            mock_notify.init(FAKE_APP_NAME)
82
 
            mock_notify.Notification.new(title, message, icon)
 
69
        mock_notify = self.mocker.replace('gi.repository.Notify')
 
70
        mock_notify.init(FAKE_APP_NAME)
 
71
        mock_notify.Notification.new(title, message, icon)
83
72
 
84
73
    def test_send_notification(self):
85
74
        """On notification, pynotify receives the proper calls."""