Merge lp:~canonical-platform-qa/address-book-app/flake8-fixes into lp:address-book-app

Proposed by Federico Gimenez on 2015-04-17
Status: Merged
Approved by: Renato Araujo Oliveira Filho on 2015-04-17
Approved revision: 423
Merged at revision: 427
Proposed branch: lp:~canonical-platform-qa/address-book-app/flake8-fixes
Merge into: lp:address-book-app
Diff against target: 300 lines (+73/-42)
8 files modified
tests/autopilot/address_book_app/__init__.py (+3/-3)
tests/autopilot/address_book_app/pages/_contact_editor.py (+4/-2)
tests/autopilot/address_book_app/pages/_sim_card_import_page.py (+4/-1)
tests/autopilot/address_book_app/tests/test_add_contact.py (+10/-9)
tests/autopilot/address_book_app/tests/test_custom_proxy_objects.py (+1/-0)
tests/autopilot/address_book_app/tests/test_edit_contact.py (+4/-2)
tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py (+18/-10)
tests/autopilot/address_book_app/tests/test_single_pick_mode.py (+29/-15)
To merge this branch: bzr merge lp:~canonical-platform-qa/address-book-app/flake8-fixes
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) 2015-04-17 Approve on 2015-04-17
PS Jenkins bot continuous-integration Needs Fixing on 2015-04-17
Leo Arias (community) Approve on 2015-04-17
Review via email: mp+256684@code.launchpad.net

Commit Message

Flake8 fixes

Description of the Change

Flake8 fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/address_book_app/__init__.py'
2--- tests/autopilot/address_book_app/__init__.py 2015-03-05 22:46:37 +0000
3+++ tests/autopilot/address_book_app/__init__.py 2015-04-17 15:26:15 +0000
4@@ -98,12 +98,12 @@
5 return None
6
7 def start_import_contacts(self):
8- header = self.open_header()
9+ self.open_header()
10 view = self.get_contact_list_view()
11 if view.count > 0:
12 self.click_action_button("importFromSimHeaderButton")
13 else:
14- import_buttom = self.select_single(
15+ import_buttom = self.select_single(
16 'ContactListButtonDelegate',
17 objectName='contactListView.importFromSimCardButton')
18 self.pointing_device.click_object(import_buttom)
19@@ -161,7 +161,7 @@
20 """
21 Press the 'confirm' button
22 """
23- header = self.open_header()
24+ self.open_header()
25 self.click_action_button("confirmImport")
26
27 def get_toolbar(self):
28
29=== modified file 'tests/autopilot/address_book_app/pages/_contact_editor.py'
30--- tests/autopilot/address_book_app/pages/_contact_editor.py 2014-08-20 18:27:37 +0000
31+++ tests/autopilot/address_book_app/pages/_contact_editor.py 2015-04-17 15:26:15 +0000
32@@ -75,9 +75,11 @@
33 add_field_button.height.wait_for(add_field_button.expandedHeight)
34 self.wait_to_stop_moving()
35
36- options_list = add_field_button.select_single("QQuickListView",
37+ options_list = add_field_button.select_single(
38+ "QQuickListView",
39 objectName="listViewOptions")
40- new_field_item = options_list.select_single("Standard",
41+ new_field_item = options_list.select_single(
42+ "Standard",
43 objectName=self._DETAIL_ALIAS[detail_name])
44 new_field_item.swipe_into_view()
45
46
47=== modified file 'tests/autopilot/address_book_app/pages/_sim_card_import_page.py'
48--- tests/autopilot/address_book_app/pages/_sim_card_import_page.py 2015-03-03 18:58:53 +0000
49+++ tests/autopilot/address_book_app/pages/_sim_card_import_page.py 2015-04-17 15:26:15 +0000
50@@ -17,6 +17,7 @@
51 import logging
52
53 import autopilot.logging
54+import time
55
56 from address_book_app.pages import _common
57
58@@ -24,6 +25,7 @@
59 log_action_info = autopilot.logging.log_action(logging.info)
60 log_action_debug = autopilot.logging.log_action(logging.debug)
61
62+
63 class SIMCardImportPage(_common.PageWithHeader):
64 """Autopilot helper for the SIMCardImportPage page."""
65
66@@ -95,6 +97,7 @@
67 for index in indices:
68 contact = self._get_contact_delegate(index)
69 self.pointing_device.click_object(contact)
70- contacts.append(contact.select_single('Label', objectName='nameLabel').text)
71+ contacts.append(contact.select_single(
72+ 'Label', objectName='nameLabel').text)
73
74 return contacts
75
76=== modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py'
77--- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-06-29 03:18:16 +0000
78+++ tests/autopilot/address_book_app/tests/test_add_contact.py 2015-04-17 15:26:15 +0000
79@@ -108,9 +108,9 @@
80 objectName="emails")
81 self.assertThat(email_group.detailsCount, Eventually(Equals(3)))
82
83- emails = {"home@email.com" : "Home",
84- "work@email.com" : "Work",
85- "other@email.com" : "Other"}
86+ emails = {"home@email.com": "Home",
87+ "work@email.com": "Work",
88+ "other@email.com": "Other"}
89
90 # Check if they have the correct label
91 for idx in range(3):
92@@ -134,7 +134,8 @@
93 my_phones.append(data.Phone(type_="Home", number="(000) 000-0000"))
94 my_phones.append(data.Phone(type_="Work", number="(000) 000-0001"))
95 my_phones.append(data.Phone(type_="Mobile", number="(000) 000-0002"))
96- my_phones.append(data.Phone(type_="Work Mobile", number="(000) 000-0003"))
97+ my_phones.append(data.Phone(type_="Work Mobile",
98+ number="(000) 000-0003"))
99 my_phones.append(data.Phone(type_="Other", number="(000) 000-0004"))
100
101 test_contact = data.Contact(first_name="Sherlock",
102@@ -156,11 +157,11 @@
103 objectName="phones")
104 self.assertThat(phone_group.detailsCount, Eventually(Equals(5)))
105
106- phones = {"(000) 000-0000" : "Home",
107- "(000) 000-0001" : "Work",
108- "(000) 000-0002" : "Mobile",
109- "(000) 000-0003" : "Work Mobile",
110- "(000) 000-0004" : "Other"}
111+ phones = {"(000) 000-0000": "Home",
112+ "(000) 000-0001": "Work",
113+ "(000) 000-0002": "Mobile",
114+ "(000) 000-0003": "Work Mobile",
115+ "(000) 000-0004": "Other"}
116
117 # Check if they have the correct label
118 for idx in range(5):
119
120=== modified file 'tests/autopilot/address_book_app/tests/test_custom_proxy_objects.py'
121--- tests/autopilot/address_book_app/tests/test_custom_proxy_objects.py 2014-05-22 12:50:28 +0000
122+++ tests/autopilot/address_book_app/tests/test_custom_proxy_objects.py 2015-04-17 15:26:15 +0000
123@@ -18,6 +18,7 @@
124
125 from address_book_app import data, tests
126
127+
128 class ContactEditorTestCase(tests.AddressBookAppTestCase):
129
130 def test_fill_form(self):
131
132=== modified file 'tests/autopilot/address_book_app/tests/test_edit_contact.py'
133--- tests/autopilot/address_book_app/tests/test_edit_contact.py 2014-06-17 17:58:07 +0000
134+++ tests/autopilot/address_book_app/tests/test_edit_contact.py 2015-04-17 15:26:15 +0000
135@@ -61,7 +61,8 @@
136 phone_label_1 = view_page.select_single(
137 "Label",
138 objectName="label_phoneNumber_1.0")
139- self.assertThat(phone_label_1.text, Eventually(Equals(self.PHONE_NUMBERS[1])))
140+ self.assertThat(phone_label_1.text,
141+ Eventually(Equals(self.PHONE_NUMBERS[1])))
142
143 def test_remove_phone(self):
144 contact_editor = self.app.main_window.go_to_add_contact()
145@@ -97,7 +98,8 @@
146 phone_label_1 = view_page.select_single(
147 "Label",
148 objectName="label_phoneNumber_0.0")
149- self.assertThat(phone_label_1.text, Eventually(Equals(self.PHONE_NUMBERS[1])))
150+ self.assertThat(phone_label_1.text,
151+ Eventually(Equals(self.PHONE_NUMBERS[1])))
152
153 def test_add_email(self):
154 self.add_contact("Fulano", "")
155
156=== modified file 'tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py'
157--- tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py 2014-09-02 19:23:05 +0000
158+++ tests/autopilot/address_book_app/tests/test_multiple_pick_mode.py 2015-04-17 15:26:15 +0000
159@@ -31,20 +31,23 @@
160 item_to_contacts = {}
161 for contact in contacts:
162 if (contact.visible):
163- item = contact.select_single("QQuickRectangle", objectName="mainItem")
164+ item = contact.select_single("QQuickRectangle",
165+ objectName="mainItem")
166 self.assertThat(item.color, Eventually(Equals(contact.color)))
167 items.append(item)
168 item_to_contacts[item] = contact
169
170 # click on mark 1
171- selected_items = [ items[1] ]
172+ selected_items = [items[1]]
173 self.pointing_device.click_object(items[1])
174
175 for item in items:
176 if item in selected_items:
177- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(True)))
178+ self.assertThat(item_to_contacts[item].selected,
179+ Eventually(Equals(True)))
180 else:
181- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(False)))
182+ self.assertThat(item_to_contacts[item].selected,
183+ Eventually(Equals(False)))
184
185 # click on mark 2
186 selected_items.append(items[2])
187@@ -52,9 +55,11 @@
188
189 for item in items:
190 if item in selected_items:
191- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(True)))
192+ self.assertThat(item_to_contacts[item].selected,
193+ Eventually(Equals(True)))
194 else:
195- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(False)))
196+ self.assertThat(item_to_contacts[item].selected,
197+ Eventually(Equals(False)))
198
199 # click on mark 0
200 selected_items.append(items[0])
201@@ -62,12 +67,15 @@
202
203 for item in items:
204 if item in selected_items:
205- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(True)))
206+ self.assertThat(item_to_contacts[item].selected,
207+ Eventually(Equals(True)))
208 else:
209- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(False)))
210+ self.assertThat(item_to_contacts[item].selected,
211+ Eventually(Equals(False)))
212
213- buttons = pick_page.select_many("Button", objectName="DialogButtons.acceptButton")
214+ buttons = pick_page.select_many(
215+ "Button",
216+ objectName="DialogButtons.acceptButton")
217 for b in buttons:
218 if b.visible:
219 self.pointing_device.click_object(b)
220-
221
222=== modified file 'tests/autopilot/address_book_app/tests/test_single_pick_mode.py'
223--- tests/autopilot/address_book_app/tests/test_single_pick_mode.py 2014-09-02 19:23:05 +0000
224+++ tests/autopilot/address_book_app/tests/test_single_pick_mode.py 2015-04-17 15:26:15 +0000
225@@ -30,7 +30,8 @@
226 item_to_contacts = {}
227 for contact in contacts:
228 if (contact.visible):
229- item = contact.select_single("QQuickRectangle", objectName="mainItem")
230+ item = contact.select_single("QQuickRectangle",
231+ objectName="mainItem")
232 self.assertThat(item.color, Eventually(Equals(contact.color)))
233 selected_items.append(item)
234 item_to_contacts[item] = contact
235@@ -41,11 +42,15 @@
236
237 for item in selected_items:
238 if item == selected_item:
239- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(True)))
240- self.assertThat(item.color, Eventually(Equals(contact.selectedColor)))
241+ self.assertThat(item_to_contacts[item].selected,
242+ Eventually(Equals(True)))
243+ self.assertThat(item.color,
244+ Eventually(Equals(contact.selectedColor)))
245 else:
246- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(False)))
247- self.assertThat(item.color, Eventually(Equals(contact.color)))
248+ self.assertThat(item_to_contacts[item].selected,
249+ Eventually(Equals(False)))
250+ self.assertThat(item.color,
251+ Eventually(Equals(contact.color)))
252
253 # click on item 2
254 selected_item = selected_items[2]
255@@ -53,11 +58,15 @@
256
257 for item in selected_items:
258 if item == selected_item:
259- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(True)))
260- self.assertThat(item.color, Eventually(Equals(contact.selectedColor)))
261+ self.assertThat(item_to_contacts[item].selected,
262+ Eventually(Equals(True)))
263+ self.assertThat(item.color,
264+ Eventually(Equals(contact.selectedColor)))
265 else:
266- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(False)))
267- self.assertThat(item.color, Eventually(Equals(contact.color)))
268+ self.assertThat(item_to_contacts[item].selected,
269+ Eventually(Equals(False)))
270+ self.assertThat(item.color,
271+ Eventually(Equals(contact.color)))
272
273 # click on item 0
274 selected_item = selected_items[0]
275@@ -65,14 +74,19 @@
276
277 for item in selected_items:
278 if item == selected_item:
279- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(True)))
280- self.assertThat(item.color, Eventually(Equals(contact.selectedColor)))
281+ self.assertThat(item_to_contacts[item].selected,
282+ Eventually(Equals(True)))
283+ self.assertThat(item.color,
284+ Eventually(Equals(contact.selectedColor)))
285 else:
286- self.assertThat(item_to_contacts[item].selected, Eventually(Equals(False)))
287- self.assertThat(item.color, Eventually(Equals(contact.color)))
288+ self.assertThat(item_to_contacts[item].selected,
289+ Eventually(Equals(False)))
290+ self.assertThat(item.color,
291+ Eventually(Equals(contact.color)))
292
293- buttons = pick_page.select_many("Button", objectName="DialogButtons.acceptButton")
294+ buttons = pick_page.select_many(
295+ "Button",
296+ objectName="DialogButtons.acceptButton")
297 for b in buttons:
298 if b.visible:
299 self.pointing_device.click_object(b)
300-

Subscribers

People subscribed via source and target branches