NotificationTestCase failures

Bug #921574 reported by Natalia Bidart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Status tracked in Trunk
Stable-3-0
Fix Released
Undecided
dobey
Trunk
Fix Released
Medium
dobey

Bug Description

Trace is:

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/home/nessita/canonical/client/trunk/tests/platform/linux/test_notification.py", line 58, in tearDown
    self.mocker.verify()
  File "/usr/lib/python2.7/dist-packages/mocker.py", line 579, in verify
    raise AssertionError(os.linesep.join(message))
exceptions.AssertionError: [Mocker] Unmet expectations:

=> pynotify.init('Teh wonderful app.')
 - Performed fewer times than expected.

=> pynotify.Notification('Sous titre', 'Oi! You there!', 'ubuntuone')
 - Performed fewer times than expected.

=> mock_notification.set_hint_string('x-canonical-append', '')
 - Performed fewer times than expected.

=> mock_notification.show()
 - Performed fewer times than expected.

=> mock_notification.update('Sous titre', 'Appendix I.', 'ubuntuone')
 - Performed fewer times than expected.

=> mock_notification.set_hint_string('x-canonical-append', '')
 - Performed fewer times than expected.

=> mock_notification.show()
 - Performed fewer times than expected.

tests.platform.linux.test_notification.NotificationTestCase.test_append_notification
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/home/nessita/canonical/client/trunk/tests/platform/linux/test_notification.py", line 58, in tearDown
    self.mocker.verify()
  File "/usr/lib/python2.7/dist-packages/mocker.py", line 579, in verify
    raise AssertionError(os.linesep.join(message))
exceptions.AssertionError: [Mocker] Unmet expectations:

=> pynotify.init('Teh wonderful app.')
 - Performed fewer times than expected.

=> pynotify.Notification('Sous titre', 'Oi! You there!', 'ubuntuone')
 - Performed fewer times than expected.

=> mock_notification.show()
 - Performed fewer times than expected.

tests.platform.linux.test_notification.NotificationTestCase.test_send_notification
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/home/nessita/canonical/client/trunk/tests/platform/linux/test_notification.py", line 58, in tearDown
    self.mocker.verify()
  File "/usr/lib/python2.7/dist-packages/mocker.py", line 579, in verify
    raise AssertionError(os.linesep.join(message))
exceptions.AssertionError: [Mocker] Unmet expectations:

=> pynotify.init('Teh wonderful app.')
 - Performed fewer times than expected.

=> pynotify.Notification('Sous titre', 'Oi! You there!', 'fakicon')
 - Performed fewer times than expected.

=> mock_notification.show()
 - Performed fewer times than expected.

tests.platform.linux.test_notification.NotificationTestCase.test_send_notification_with_icon
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/home/nessita/canonical/client/trunk/tests/platform/linux/test_notification.py", line 58, in tearDown
    self.mocker.verify()
  File "/usr/lib/python2.7/dist-packages/mocker.py", line 579, in verify
    raise AssertionError(os.linesep.join(message))
exceptions.AssertionError: [Mocker] Unmet expectations:

=> pynotify.init('Teh wonderful app.')
 - Performed fewer times than expected.

=> pynotify.Notification('Sous titre', 'Oi! You there!', 'ubuntuone')
 - Performed fewer times than expected.

=> mock_notification.show()
 - Performed fewer times than expected.

=> mock_notification.update('Sous titre2', 'Oi! You there!2', 'ubuntuone')
 - Performed fewer times than expected.

=> mock_notification.show()
 - Performed fewer times than expected.

tests.platform.linux.test_notification.NotificationTestCase.test_send_two_notifications
-------------------------------------------------------------------------------
Ran 2516 tests in 818.915s

FAILED (skips=12, errors=4, successes=2500)

I asked alecu about this, and he said:

(10:30:45 AM) alecu: nessita, it seems that the tests are "mocking" the pynotify module. But if the pynotify module is not installed the platform dependent code just does not install a notifier.
(10:31:26 AM) alecu: nessita, and it also happens that the pynotify module is not installed either if the notify GI is available.
(10:31:57 AM) alecu: nessita, so: either there's a GI for pynotify now, or the pynotify module is not installed.
(10:32:42 AM) alecu: nessita, in any case we should make the notify tests be a bit more smarter, and find out what the real notification module is.
(10:34:29 AM) alecu: nessita, right. And that means that the pynotify module is notinstalled
(10:34:41 AM) alecu: nessita, (I mean, by our code)
(10:34:47 AM) alecu: *imported (not installed)

Related branches

Changed in ubuntuone-client:
assignee: nobody → Alejandro J. Cura (alecu)
importance: Undecided → Medium
status: New → Triaged
dobey (dobey)
Changed in ubuntuone-client:
assignee: Alejandro J. Cura (alecu) → Rodney Dawes (dobey)
dobey (dobey)
Changed in ubuntuone-client:
milestone: none → 2.99.3
milestone: 2.99.3 → none
Changed in ubuntuone-client:
status: Triaged → Fix Committed
dobey (dobey)
Changed in ubuntuone-client:
milestone: none → 2.99.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.