Merge lp:~diegosarmentero/ubuntuone-windows-installer/local-folders-get_info-fail into lp:ubuntuone-windows-installer

Proposed by Diego Sarmentero
Status: Merged
Approved by: Roberto Alsina
Approved revision: 77
Merged at revision: 75
Proposed branch: lp:~diegosarmentero/ubuntuone-windows-installer/local-folders-get_info-fail
Merge into: lp:ubuntuone-windows-installer
Diff against target: 46 lines (+21/-1)
2 files modified
ubuntuone_installer/gui/qt/local_folders.py (+2/-1)
ubuntuone_installer/gui/qt/tests/test_local_folders.py (+19/-0)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-windows-installer/local-folders-get_info-fail
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Natalia Bidart (community) Approve
Review via email: mp+77718@code.launchpad.net

Commit message

Fixed: LocalFoldersPage.get_info does not hide the overlay on backend error (LP: #828944).

Description of the change

Fixed: LocalFoldersPage.get_info does not hide the overlay on backend error (LP: #828944).

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

ubuntuone_installer/gui/qt/tests/test_local_folders.py:
    301: [C0111, LocalFoldersTestCase.raise_exception] Missing docstring

review: Needs Fixing
76. By Diego Sarmentero

Fixed lint issues and improved get_info

77. By Diego Sarmentero

Added overlay.hide inside finally.

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

Looks good!

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

+1

review: Approve

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-13 02:10:13 +0000
3+++ ubuntuone_installer/gui/qt/local_folders.py 2011-09-30 15:43:23 +0000
4@@ -160,10 +160,11 @@
5 item = yield self.add_folder(folder_name, validate=True)
6 self.timer.start(2000)
7 self.timer.timeout.connect(self.update_sizes)
8- self.wizard().overlay.hide()
9 self.wizard().currentIdChanged.connect(self.changed_page)
10 except:
11 logger.exception("Error getting backend info:")
12+ finally:
13+ self.wizard().overlay.hide()
14
15 @QtCore.pyqtSlot("int")
16 @inlineCallbacks
17
18=== modified file 'ubuntuone_installer/gui/qt/tests/test_local_folders.py'
19--- ubuntuone_installer/gui/qt/tests/test_local_folders.py 2011-09-15 17:49:32 +0000
20+++ ubuntuone_installer/gui/qt/tests/test_local_folders.py 2011-09-30 15:43:23 +0000
21@@ -292,6 +292,25 @@
22 self.assertEqual(self.ui.ui.folder_list.topLevelItemCount(), 4)
23
24 @defer.inlineCallbacks
25+ def test_get_info_not_fail(self):
26+ """Check if the overlay is hidden on get_info finish."""
27+ self.assertEqual(self.ui.wizard().overlay.hide_counter, 0)
28+ yield self.ui.get_info()
29+ self.assertEqual(self.ui.wizard().overlay.hide_counter, 1)
30+
31+ def raise_exception(self):
32+ """Raise exception to make the get_info method fail."""
33+ raise Exception()
34+
35+ @defer.inlineCallbacks
36+ def test_get_info_fail(self):
37+ """Check if the overlay is hidden on fail."""
38+ self.patch(self.ui.cp_backend, "volumes_info", self.raise_exception)
39+ self.assertEqual(self.ui.wizard().overlay.hide_counter, 0)
40+ yield self.ui.get_info()
41+ self.assertEqual(self.ui.wizard().overlay.hide_counter, 1)
42+
43+ @defer.inlineCallbacks
44 def test_subscribed_udf_checked(self):
45 """Check that subscribed UDF items are created correctly."""
46 yield self.ui.get_info()

Subscribers

People subscribed via source and target branches