~ralsina/ubuntuone-client/fix_712674

« back to all changes in this revision

Viewing changes to tests/platform/linux/test_messaging.py

  • Committer: Tarmac
  • Author(s): eric.casteleijn at canonical
  • Date: 2011-02-10 18:23:32 UTC
  • mfrom: (843.2.8 lp-702055)
  • Revision ID: tarmac-20110210182332-u1tx2s9jiwpob5z5
This adds notifications and messaging on new incoming shares and UDFs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        self.mocker.restore()
50
50
        self.mocker.verify()
51
51
 
 
52
    # pylint: disable=R0913
52
53
    def _show_message_setup(self, message_time=None, message_count=None,
53
54
                            icon=None, update_count=None, hide=False):
54
55
        """Set up the mocker expectations for show_method."""
81
82
        mock_indicator.set_property("draw-attention", "true")
82
83
        mock_server.show()
83
84
        if update_count:
84
 
            mock_indicator.set_property("count", str(update_count))
 
85
            mock_indicator.get_property("count")
 
86
            self.mocker.result("1200")
 
87
            mock_indicator.set_property("count", '2500')
85
88
        if hide:
86
89
            mock_indicator.set_property('draw-attention', 'false')
87
90
            mock_indicator.hide()
88
91
        mock_indicator.show()
89
92
        self.mocker.replay()
 
93
    # pylint: enable=R0913
90
94
 
91
95
    def test_show_message(self):
92
96
        """On message, libnotify receives the proper calls."""
116
120
        """On message count update, libnotify receives the proper calls."""
117
121
        self._show_message_setup(message_count='1200', update_count='1300')
118
122
        messaging = Messaging()
119
 
        messaging.show_message(FAKE_SENDER, callback, message_count=1200)
120
 
        messaging.update_count(FAKE_SENDER, 1300)
 
123
        indicator = messaging.show_message(
 
124
            FAKE_SENDER, callback, message_count=1200)
 
125
        messaging.update_count(indicator, 1300)
121
126
 
122
127
    def test_hide_message(self):
123
128
        """On message hide, libnotify receives the proper calls."""