Merge lp:~ralsina/ubuntuone-windows-installer/empty-folder-list into lp:ubuntuone-windows-installer

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 76
Merged at revision: 58
Proposed branch: lp:~ralsina/ubuntuone-windows-installer/empty-folder-list
Merge into: lp:ubuntuone-windows-installer
Prerequisite: lp:~ralsina/ubuntuone-windows-installer/back-is-wrong
Diff against target: 30 lines (+9/-0)
2 files modified
ubuntuone_installer/gui/qt/local_folders.py (+1/-0)
ubuntuone_installer/gui/qt/tests/test_local_folders.py (+8/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-windows-installer/empty-folder-list
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+75043@code.launchpad.net

Commit message

Clean the items dict when cleaning the item list.

Description of the change

Clean the items dict when cleaning the item list.

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Can you please add a test case validating this change? Thanks!

review: Needs Fixing
Revision history for this message
Roberto Alsina (ralsina) wrote :

> Can you please add a test case validating this change? Thanks!

I will try, but it's really tricky!

Revision history for this message
Roberto Alsina (ralsina) wrote :

Turns out it was not tricky at all :-)

Test added in revno 76

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good!

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone_installer/gui/qt/local_folders.py'
2--- ubuntuone_installer/gui/qt/local_folders.py 2011-09-12 17:38:00 +0000
3+++ ubuntuone_installer/gui/qt/local_folders.py 2011-09-12 17:38:01 +0000
4@@ -144,6 +144,7 @@
5 if volume[u'type'] == u"UDF":
6 self.folders_info.append(volume)
7 self.ui.folder_list.clear()
8+ self.items = {}
9 for folder in self.folders_info:
10 if folder['subscribed']:
11 item = yield self.add_folder(
12
13=== modified file 'ubuntuone_installer/gui/qt/tests/test_local_folders.py'
14--- ubuntuone_installer/gui/qt/tests/test_local_folders.py 2011-09-12 17:38:00 +0000
15+++ ubuntuone_installer/gui/qt/tests/test_local_folders.py 2011-09-12 17:38:01 +0000
16@@ -284,6 +284,14 @@
17 self.assertNotIn('shared', self.ui.items)
18
19 @defer.inlineCallbacks
20+ def test_get_info_twice(self):
21+ """Calling initialize twice should be invariant."""
22+ yield self.ui.get_info()
23+ self.assertEqual(self.ui.ui.folder_list.topLevelItemCount(), 4)
24+ yield self.ui.get_info()
25+ self.assertEqual(self.ui.ui.folder_list.topLevelItemCount(), 4)
26+
27+ @defer.inlineCallbacks
28 def test_subscribed_udf_checked(self):
29 """Check that subscribed UDF items are created correctly."""
30 yield self.ui.get_info()

Subscribers

People subscribed via source and target branches