Merge lp:~diegosarmentero/ubuntuone-client/ubuntuone-client-fix-tests into lp:ubuntuone-client

Proposed by Diego Sarmentero on 2012-10-03
Status: Merged
Approved by: dobey on 2012-10-05
Approved revision: 1331
Merged at revision: 1333
Proposed branch: lp:~diegosarmentero/ubuntuone-client/ubuntuone-client-fix-tests
Merge into: lp:ubuntuone-client
Diff against target: 32 lines (+7/-4)
1 file modified
tests/platform/sync_menu/test_linux.py (+7/-4)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-client/ubuntuone-client-fix-tests
Reviewer Review Type Date Requested Status
Vincent Ladeuil (community) Approve on 2012-10-05
dobey (community) 2012-10-03 Approve on 2012-10-03
Review via email: mp+127836@code.launchpad.net

Commit Message

- Fixed failing test (LP: #1061100).

To post a comment you must log in.
dobey (dobey) :
review: Approve
Vincent Ladeuil (vila) wrote :

May I suggest:

15 # The menu should only show 5 current transfers.

Your change makes this 5 a 6.

review: Needs Fixing
1331. By Diego Sarmentero on 2012-10-05

fix comment

Diego Sarmentero (diegosarmentero) wrote :

> May I suggest:
>
> 15 # The menu should only show 5 current transfers.
>
> Your change makes this 5 a 6.

comment updated

Vincent Ladeuil (vila) wrote :

thanks, it was worth updating the comment, I wouldn't have thought about a separator...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/platform/sync_menu/test_linux.py'
2--- tests/platform/sync_menu/test_linux.py 2012-10-01 13:32:57 +0000
3+++ tests/platform/sync_menu/test_linux.py 2012-10-05 15:17:24 +0000
4@@ -334,7 +334,6 @@
5 self.assertEqual(len(children), 5)
6 data_current.reverse()
7 for item in children[6:]:
8- print repr(item)
9 text = item.property_get(linux.Dbusmenu.MENUITEM_PROP_LABEL)
10 self.assertIn(text, uploading_data)
11 size, written = uploading_data[text]
12@@ -363,13 +362,17 @@
13 self.status_frontend.uploading_data = data_current
14 self.sync_menu.transfers.update_progress()
15 children = self.sync_menu.transfers.get_children()
16- # The menu should only show 5 current transfers.
17- self.assertEqual(len(children), 5)
18- for i, item in enumerate(children):
19+ # The menu should only show 5 current transfers and a separator item.
20+ self.assertEqual(len(children), 6)
21+ i = 0
22+ for item in children:
23 text = item.property_get(linux.Dbusmenu.MENUITEM_PROP_LABEL)
24+ if text is None:
25+ continue
26 percentage = item.property_get_int(
27 linux.SyncMenu.PROGRESS_MENUITEM_PROP_PERCENT_DONE)
28 name, size, written = expected[i]
29+ i += 1
30 percentage_expected = written * 100 / size
31 self.assertEqual(text, name)
32 self.assertEqual(percentage, percentage_expected)

Subscribers

People subscribed via source and target branches