Merge lp:~alecu/ubuntuone-client/fix-notification-parameters into lp:ubuntuone-client

Proposed by Alejandro J. Cura
Status: Merged
Approved by: Martin Albisetti
Approved revision: 807
Merged at revision: 808
Proposed branch: lp:~alecu/ubuntuone-client/fix-notification-parameters
Merge into: lp:ubuntuone-client
Diff against target: 44 lines (+5/-5)
2 files modified
tests/status/test_aggregator.py (+3/-3)
ubuntuone/status/aggregator.py (+2/-2)
To merge this branch: bzr merge lp:~alecu/ubuntuone-client/fix-notification-parameters
Reviewer Review Type Date Requested Status
Martin Albisetti (community) Approve
Eric Casteleijn (community) Approve
Review via email: mp+46358@code.launchpad.net

Commit message

fix the parameters passed to send_notification

Description of the change

fix the parameters passed to send_notification.
The third parameter was supposed to be an icon, but it was being passed a boolean.
Since both parameters are optional, the last parameter passed by the caller was removed.

To post a comment you must log in.
Revision history for this message
Eric Casteleijn (thisfred) wrote :

+1

review: Approve
Revision history for this message
Martin Albisetti (beuno) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/status/test_aggregator.py'
--- tests/status/test_aggregator.py 2011-01-14 17:15:40 +0000
+++ tests/status/test_aggregator.py 2011-01-14 22:53:10 +0000
@@ -33,7 +33,7 @@
3333
34 def send_notification(self, title, message, icon=None, append=False):34 def send_notification(self, title, message, icon=None, append=False):
35 """Show a notification to the user."""35 """Show a notification to the user."""
36 self.notifications_shown.append((title, message, append))36 self.notifications_shown.append((title, message, icon, append))
3737
3838
39class StatusAggregatorTestCase(TestCase):39class StatusAggregatorTestCase(TestCase):
@@ -59,7 +59,7 @@
59 self.listener.handle_AQ_CHANGE_PUBLIC_ACCESS_OK(share_id, node_id,59 self.listener.handle_AQ_CHANGE_PUBLIC_ACCESS_OK(share_id, node_id,
60 is_public, public_url)60 is_public, public_url)
61 notification = (aggregator.FILE_PUBLISHED_TITLE,61 notification = (aggregator.FILE_PUBLISHED_TITLE,
62 aggregator.FILE_PUBLISHED_MESSAGE, False)62 aggregator.FILE_PUBLISHED_MESSAGE, None, False)
63 self.assertIn(notification, self.fake_notification.notifications_shown)63 self.assertIn(notification, self.fake_notification.notifications_shown)
6464
6565
@@ -73,5 +73,5 @@
73 self.listener.handle_AQ_CHANGE_PUBLIC_ACCESS_OK(share_id, node_id,73 self.listener.handle_AQ_CHANGE_PUBLIC_ACCESS_OK(share_id, node_id,
74 is_public, public_url)74 is_public, public_url)
75 notification = (aggregator.FILE_UNPUBLISHED_TITLE,75 notification = (aggregator.FILE_UNPUBLISHED_TITLE,
76 aggregator.FILE_UNPUBLISHED_MESSAGE, False)76 aggregator.FILE_UNPUBLISHED_MESSAGE, None, False)
77 self.assertIn(notification, self.fake_notification.notifications_shown)77 self.assertIn(notification, self.fake_notification.notifications_shown)
7878
=== modified file 'ubuntuone/status/aggregator.py'
--- ubuntuone/status/aggregator.py 2011-01-14 17:15:40 +0000
+++ ubuntuone/status/aggregator.py 2011-01-14 22:53:10 +0000
@@ -35,9 +35,9 @@
35 def file_published(self):35 def file_published(self):
36 """A file was published."""36 """A file was published."""
37 self.notification.send_notification(FILE_PUBLISHED_TITLE,37 self.notification.send_notification(FILE_PUBLISHED_TITLE,
38 FILE_PUBLISHED_MESSAGE, False)38 FILE_PUBLISHED_MESSAGE)
3939
40 def file_unpublished(self):40 def file_unpublished(self):
41 """A file was unpublished."""41 """A file was unpublished."""
42 self.notification.send_notification(FILE_UNPUBLISHED_TITLE,42 self.notification.send_notification(FILE_UNPUBLISHED_TITLE,
43 FILE_UNPUBLISHED_MESSAGE, False)43 FILE_UNPUBLISHED_MESSAGE)

Subscribers

People subscribed via source and target branches