Merge lp:~diegosarmentero/ubuntuone-windows-installer/successful-page into lp:ubuntuone-windows-installer

Proposed by Diego Sarmentero
Status: Merged
Approved by: Natalia Bidart
Approved revision: 94
Merged at revision: 86
Proposed branch: lp:~diegosarmentero/ubuntuone-windows-installer/successful-page
Merge into: lp:ubuntuone-windows-installer
Prerequisite: lp:~mandel/ubuntuone-windows-installer/fix-reactor-import
Diff against target: 292 lines (+183/-19)
5 files modified
data/qt/network_detection.ui (+150/-0)
ubuntuone_installer/gui/qt/gui.py (+9/-2)
ubuntuone_installer/gui/qt/tests/__init__.py (+16/-0)
ubuntuone_installer/gui/qt/tests/test_gui.py (+7/-0)
ubuntuone_installer/gui/qt/tests/test_side_widget.py (+1/-17)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-windows-installer/successful-page
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
Natalia Bidart (community) Approve
Diego Sarmentero (community) Abstain
Review via email: mp+79857@code.launchpad.net

This proposal supersedes a proposal from 2011-10-19.

Commit message

- Fixed: Process finished successfully (LP: #859743).

Description of the change

Fixed: Process finished successfully (LP: #859743).

To post a comment you must log in.
86. By Diego Sarmentero

Fixed tests

87. By Diego Sarmentero

merge

88. By Diego Sarmentero

Conflicts resolved

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1... i don't know why i appear as a reviewer of my own branch :P

review: Approve
Revision history for this message
Diego Sarmentero (diegosarmentero) :
review: Abstain
89. By Diego Sarmentero

merge

90. By Diego Sarmentero

merge

91. By Diego Sarmentero

Fixed lint issues

92. By Diego Sarmentero

merge

Revision history for this message
Natalia Bidart (nataliabidart) wrote :
Download full text (7.2 KiB)

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1020, in _inlineCallbacks
    result = g.send(result)
  File "/home/nessita/canonical/windows-installer/review_successful-page/ubuntuone_installer/gui/qt/tests/__init__.py", line 204, in setUp
    self.ui = self.class_ui(**self.kwargs)
  File "/home/nessita/canonical/windows-installer/review_successful-page/ubuntuone_installer/gui/qt/gui.py", line 431, in __init__
    self.success = SuccessPage(self)
  File "/home/nessita/canonical/windows-installer/review_successful-page/ubuntuone_installer/gui/qt/gui.py", line 278, in __init__
    self.ui.image_label.setPixmap(
exceptions.AttributeError: 'Ui_SuccessPage' object has no attribute 'image_label'

ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_choose_signin_cancel
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_close_callback_can_be_none
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_congratulations_adds_to_autostart
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_continue_cancels_cancel
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_critical
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_critical_in_proper_page
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_current_user_controller_parameters
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_current_user_controller_params
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_current_user_initialize
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_done_calls_custom_close_callback
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_execute_uninstall_on_licence_cancel
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_execute_uninstall_on_licence_cancel_frozen
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_folders_page_next_id
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_folders_page_with_back
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_forgotten_password_controller_error
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_forgotten_password_controller_params
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_initialize_page
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_insert_remove_critical_message
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_license_page_check_connection_error
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_license_page_check_connection_no_button
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_main_window_general_config
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_network_detection_connection_disabled
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_network_detection_connection_disabled_signin
ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_network_detection_connection_enabled
ubuntuone_installer.gui.qt.tests.test_...

Read more...

review: Needs Fixing
93. By Diego Sarmentero

Removed changes from network-detect branch

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

Looks good!

Please unify the assertEqualPixmaps definition moving it to BaseTestCase.

review: Approve
94. By Diego Sarmentero

Tests improved.

Revision history for this message
Alejandro J. Cura (alecu) wrote :

+1. Don't forget to set the commit message!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'data/qt/network_detection.ui'
2--- data/qt/network_detection.ui 1970-01-01 00:00:00 +0000
3+++ data/qt/network_detection.ui 2011-11-10 14:04:24 +0000
4@@ -0,0 +1,150 @@
5+<?xml version="1.0" encoding="UTF-8"?>
6+<ui version="4.0">
7+ <class>Form</class>
8+ <widget class="QWizardPage" name="Form">
9+ <property name="geometry">
10+ <rect>
11+ <x>0</x>
12+ <y>0</y>
13+ <width>541</width>
14+ <height>365</height>
15+ </rect>
16+ </property>
17+ <property name="windowTitle">
18+ <string>WizardPage</string>
19+ </property>
20+ <layout class="QVBoxLayout" name="verticalLayout">
21+ <item>
22+ <layout class="QHBoxLayout" name="horizontalLayout_2">
23+ <item>
24+ <spacer name="horizontalSpacer_3">
25+ <property name="orientation">
26+ <enum>Qt::Horizontal</enum>
27+ </property>
28+ <property name="sizeHint" stdset="0">
29+ <size>
30+ <width>40</width>
31+ <height>20</height>
32+ </size>
33+ </property>
34+ </spacer>
35+ </item>
36+ <item>
37+ <widget class="QLabel" name="image_label">
38+ <property name="sizePolicy">
39+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
40+ <horstretch>0</horstretch>
41+ <verstretch>0</verstretch>
42+ </sizepolicy>
43+ </property>
44+ <property name="minimumSize">
45+ <size>
46+ <width>400</width>
47+ <height>150</height>
48+ </size>
49+ </property>
50+ <property name="text">
51+ <string/>
52+ </property>
53+ <property name="textFormat">
54+ <enum>Qt::PlainText</enum>
55+ </property>
56+ <property name="pixmap">
57+ <pixmap resource="images.qrc">:/win_installer_graphic.png</pixmap>
58+ </property>
59+ <property name="alignment">
60+ <set>Qt::AlignCenter</set>
61+ </property>
62+ <property name="wordWrap">
63+ <bool>true</bool>
64+ </property>
65+ </widget>
66+ </item>
67+ <item>
68+ <spacer name="horizontalSpacer_4">
69+ <property name="orientation">
70+ <enum>Qt::Horizontal</enum>
71+ </property>
72+ <property name="sizeHint" stdset="0">
73+ <size>
74+ <width>40</width>
75+ <height>20</height>
76+ </size>
77+ </property>
78+ </spacer>
79+ </item>
80+ </layout>
81+ </item>
82+ <item>
83+ <widget class="QLabel" name="message_label">
84+ <property name="text">
85+ <string>Ubuntu One has installed!</string>
86+ </property>
87+ <property name="alignment">
88+ <set>Qt::AlignCenter</set>
89+ </property>
90+ </widget>
91+ </item>
92+ <item>
93+ <layout class="QHBoxLayout" name="horizontalLayout">
94+ <item>
95+ <spacer name="horizontalSpacer">
96+ <property name="orientation">
97+ <enum>Qt::Horizontal</enum>
98+ </property>
99+ <property name="sizeHint" stdset="0">
100+ <size>
101+ <width>40</width>
102+ <height>20</height>
103+ </size>
104+ </property>
105+ </spacer>
106+ </item>
107+ <item>
108+ <widget class="QLabel" name="label">
109+ <property name="text">
110+ <string>Are you online? We can't detect an internet connection - you will need to be connected to set up Ubuntu One</string>
111+ </property>
112+ <property name="textFormat">
113+ <enum>Qt::PlainText</enum>
114+ </property>
115+ <property name="wordWrap">
116+ <bool>true</bool>
117+ </property>
118+ </widget>
119+ </item>
120+ <item>
121+ <spacer name="horizontalSpacer_2">
122+ <property name="orientation">
123+ <enum>Qt::Horizontal</enum>
124+ </property>
125+ <property name="sizeHint" stdset="0">
126+ <size>
127+ <width>40</width>
128+ <height>20</height>
129+ </size>
130+ </property>
131+ </spacer>
132+ </item>
133+ </layout>
134+ </item>
135+ <item>
136+ <spacer name="verticalSpacer">
137+ <property name="orientation">
138+ <enum>Qt::Vertical</enum>
139+ </property>
140+ <property name="sizeHint" stdset="0">
141+ <size>
142+ <width>20</width>
143+ <height>76</height>
144+ </size>
145+ </property>
146+ </spacer>
147+ </item>
148+ </layout>
149+ </widget>
150+ <resources>
151+ <include location="images.qrc"/>
152+ </resources>
153+ <connections/>
154+</ui>
155
156=== modified file 'ubuntuone_installer/gui/qt/gui.py'
157--- ubuntuone_installer/gui/qt/gui.py 2011-10-20 13:27:28 +0000
158+++ ubuntuone_installer/gui/qt/gui.py 2011-11-10 14:04:24 +0000
159@@ -57,6 +57,10 @@
160 TC_URL,
161 )
162
163+# Module used to include the resources into this file
164+# pylint: disable=W0611
165+from ubuntuone_installer.gui.qt.ui import images_rc
166+# pylint: enable=W0611
167 from ubuntuone_installer.logger import setup_logging
168 from ubuntuone_installer.gui.qt.ui import (
169 choose_sign_in_ui,
170@@ -85,6 +89,7 @@
171 CREDENTIALS_ERROR = _('Application will close.\n\n%r')
172 SKIP_TOUR = _("Skip tour, go to Dashboard")
173 START_SETUP = _("Start setup")
174+SUCCESSFUL_LOGIN = _("Login successful")
175 UPDATE_TITLE = _("Updates are available")
176 UPDATE_SOFTWARE = _("There is a new version available. "
177 "Do you want perform an upgrade?")
178@@ -214,10 +219,13 @@
179
180 def __init__(self, parent=None):
181 super(SuccessPage, self).__init__(
182- Ui_SuccessPage(), SuccessController(), parent)
183+ Ui_SuccessPage(),
184+ SuccessController(title=SUCCESSFUL_LOGIN), parent)
185 self.backend = backend.ControlBackend()
186 self.finish_button = None
187 self.next_button = None
188+ self.ui.image_label.setPixmap(
189+ QtGui.QPixmap(':/win_installer_graphic.png'))
190
191 def initializePage(self):
192 """Setup UI details."""
193@@ -330,7 +338,6 @@
194 # PyQt doesn't support the (int, page) version of addPage, so
195 # Add the pages in the right order
196 # pylint: disable=C0103
197-
198 self.license_page = LicensePage()
199 self.LICENSE_PAGE = self.addPage(self.license_page)
200
201
202=== modified file 'ubuntuone_installer/gui/qt/tests/__init__.py'
203--- ubuntuone_installer/gui/qt/tests/__init__.py 2011-11-04 11:07:11 +0000
204+++ ubuntuone_installer/gui/qt/tests/__init__.py 2011-11-10 14:04:24 +0000
205@@ -208,3 +208,19 @@
206 self.ui.backend._called.clear()
207
208 self.patch(loadingoverlay, 'LoadingOverlay', FakeOverlay)
209+
210+ def get_pixmap_data(self, pixmap):
211+ """Get the raw data of a QPixmap."""
212+ byte_array = QtCore.QByteArray()
213+ array_buffer = QtCore.QBuffer(byte_array)
214+ pixmap.save(array_buffer, "PNG")
215+ return byte_array
216+
217+ # Invalid name "assertEqualPixmap"
218+ # pylint: disable=C0103
219+
220+ def assertEqualPixmaps(self, pixmap1, pixmap2):
221+ """Compare two Qt pixmaps."""
222+ d1 = self.get_pixmap_data(pixmap1)
223+ d2 = self.get_pixmap_data(pixmap2)
224+ self.assertEqual(d1, d2)
225
226=== modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py'
227--- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-10-28 16:32:22 +0000
228+++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-11-10 14:04:24 +0000
229@@ -24,6 +24,10 @@
230 from ubuntuone.platform.credentials import APP_NAME
231 from twisted.internet import defer
232
233+# Module used to include the resources into this file
234+# pylint: disable=W0611
235+from ubuntuone_installer.gui.qt.ui import images_rc
236+# pylint: enable=W0611
237 from ubuntuone_installer.gui import NEXT
238 from ubuntuone_installer.gui.qt import gui, forgotten, utils
239 from ubuntuone_installer.gui.qt.tests import (
240@@ -623,6 +627,7 @@
241 self.overlay = FakeOverlay()
242 self.local_folders_page = FakeWizardPage()
243 self.folders_page = FakeWizardPage()
244+ self.app_name = 'app_name'
245
246 def show(self):
247 """Fake method."""
248@@ -681,6 +686,8 @@
249 QtGui.QWizard.NextButton])
250 self.assertTrue(self.ui.next_button.isDefault())
251 self.assertFalse(self.ui.finish_button.isDefault())
252+ self.assertEqualPixmaps(self.ui.ui.image_label.pixmap(),
253+ QtGui.QPixmap(':/win_installer_graphic.png'))
254 self.assertEqual(self.ui.backend.called, ['connect_files'])
255
256
257
258=== modified file 'ubuntuone_installer/gui/qt/tests/test_side_widget.py'
259--- ubuntuone_installer/gui/qt/tests/test_side_widget.py 2011-09-02 12:58:29 +0000
260+++ ubuntuone_installer/gui/qt/tests/test_side_widget.py 2011-11-10 14:04:24 +0000
261@@ -19,7 +19,7 @@
262
263 """Tests for the Qt UI."""
264
265-from PyQt4 import QtGui, QtCore
266+from PyQt4 import QtGui
267
268 from ubuntuone_installer.gui.qt.tests import BaseTestCase
269 from ubuntuone_installer.gui.qt.side_widget import SideWidget
270@@ -87,22 +87,6 @@
271 self.ui.ui.sync_label.isEnabled(), True)
272 self.check_state_pixmap(3)
273
274- def get_pixmap_data(self, pixmap):
275- """Get the raw data of a QPixmap."""
276- byte_array = QtCore.QByteArray()
277- array_buffer = QtCore.QBuffer(byte_array)
278- pixmap.save(array_buffer, "PNG")
279- return byte_array
280-
281- # Invalid name "assertEqualPixmap"
282- # pylint: disable=C0103
283-
284- def assertEqualPixmaps(self, pixmap1, pixmap2):
285- """Compare two Qt pixmaps."""
286- d1 = self.get_pixmap_data(pixmap1)
287- d2 = self.get_pixmap_data(pixmap2)
288- self.assertEqual(d1, d2)
289-
290 def check_state_pixmap(self, stage):
291 """Check if each label has the proper pixmap depending on the state."""
292 active_pixmap = QtGui.QPixmap(":/progress_arrow_orange.png")

Subscribers

People subscribed via source and target branches