Merge lp:~elopio/ubuntu-ui-toolkit/pep8_and_copyright into lp:ubuntu-ui-toolkit

Proposed by Leo Arias
Status: Merged
Approved by: Florian Boucault
Approved revision: 611
Merged at revision: 623
Proposed branch: lp:~elopio/ubuntu-ui-toolkit/pep8_and_copyright
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 673 lines (+205/-150)
6 files modified
tests/autopilot/UbuntuUiToolkit/__init__.py (+14/-5)
tests/autopilot/UbuntuUiToolkit/emulators/__init__.py (+14/-5)
tests/autopilot/UbuntuUiToolkit/emulators/main_window.py (+16/-6)
tests/autopilot/UbuntuUiToolkit/tests/__init__.py (+51/-38)
tests/autopilot/UbuntuUiToolkit/tests/gallery/__init__.py (+14/-6)
tests/autopilot/UbuntuUiToolkit/tests/gallery/test_gallery.py (+96/-90)
To merge this branch: bzr merge lp:~elopio/ubuntu-ui-toolkit/pep8_and_copyright
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu SDK team Pending
Review via email: mp+173984@code.launchpad.net

Commit message

Fixed the pep8 errors and copyright notices.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
610. By Leo Arias

Merged with trunk.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
611. By Leo Arias

Merged with trunk.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/UbuntuUiToolkit/__init__.py'
2--- tests/autopilot/UbuntuUiToolkit/__init__.py 2013-07-03 17:03:25 +0000
3+++ tests/autopilot/UbuntuUiToolkit/__init__.py 2013-07-12 04:03:28 +0000
4@@ -1,8 +1,17 @@
5 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
6-# Copyright 2012 Canonical
7-#
8-# This program is free software: you can redistribute it and/or modify it
9-# under the terms of the GNU Lesser General Public License version 3, as published
10-# by the Free Software Foundation.
11+#
12+# Copyright (C) 2012, 2013 Canonical Ltd.
13+#
14+# This program is free software; you can redistribute it and/or modify
15+# it under the terms of the GNU Lesser General Public License as published by
16+# the Free Software Foundation; version 3.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Lesser General Public License for more details.
22+#
23+# You should have received a copy of the GNU Lesser General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25
26 """Ubuntu UI Toolkit autopilot tests and emulators - top level package."""
27
28=== modified file 'tests/autopilot/UbuntuUiToolkit/emulators/__init__.py'
29--- tests/autopilot/UbuntuUiToolkit/emulators/__init__.py 2013-07-03 17:03:25 +0000
30+++ tests/autopilot/UbuntuUiToolkit/emulators/__init__.py 2013-07-12 04:03:28 +0000
31@@ -1,6 +1,15 @@
32 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
33-# Copyright 2012 Canonical
34-#
35-# This program is free software: you can redistribute it and/or modify it
36-# under the terms of the GNU General Public License version 3, as published
37-# by the Free Software Foundation.
38+#
39+# Copyright (C) 2012, 2013 Canonical Ltd.
40+#
41+# This program is free software; you can redistribute it and/or modify
42+# it under the terms of the GNU Lesser General Public License as published by
43+# the Free Software Foundation; version 3.
44+#
45+# This program is distributed in the hope that it will be useful,
46+# but WITHOUT ANY WARRANTY; without even the implied warranty of
47+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48+# GNU Lesser General Public License for more details.
49+#
50+# You should have received a copy of the GNU Lesser General Public License
51+# along with this program. If not, see <http://www.gnu.org/licenses/>.
52
53=== modified file 'tests/autopilot/UbuntuUiToolkit/emulators/main_window.py'
54--- tests/autopilot/UbuntuUiToolkit/emulators/main_window.py 2013-07-05 07:14:36 +0000
55+++ tests/autopilot/UbuntuUiToolkit/emulators/main_window.py 2013-07-12 04:03:28 +0000
56@@ -1,9 +1,19 @@
57 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
58-# Copyright 2013 Canonical
59-#
60-# This program is free software: you can redistribute it and/or modify it
61-# under the terms of the GNU General Public License version 3, as published
62-# by the Free Software Foundation.
63+#
64+# Copyright (C) 2013 Canonical Ltd.
65+#
66+# This program is free software; you can redistribute it and/or modify
67+# it under the terms of the GNU Lesser General Public License as published by
68+# the Free Software Foundation; version 3.
69+#
70+# This program is distributed in the hope that it will be useful,
71+# but WITHOUT ANY WARRANTY; without even the implied warranty of
72+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
73+# GNU Lesser General Public License for more details.
74+#
75+# You should have received a copy of the GNU Lesser General Public License
76+# along with this program. If not, see <http://www.gnu.org/licenses/>.
77+
78
79 class MainWindow(object):
80 """An emulator class that makes it easy to interact with the camera-app."""
81@@ -17,6 +27,6 @@
82
83 def get_object(self, typeName, name):
84 return self.app.select_single(typeName, objectName=name)
85-
86+
87 def get_object_by_text(self, typeName, itemText):
88 return self.app.select_single(typeName, text=itemText)
89
90=== modified file 'tests/autopilot/UbuntuUiToolkit/tests/__init__.py'
91--- tests/autopilot/UbuntuUiToolkit/tests/__init__.py 2013-07-03 17:03:25 +0000
92+++ tests/autopilot/UbuntuUiToolkit/tests/__init__.py 2013-07-12 04:03:28 +0000
93@@ -1,9 +1,18 @@
94 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
95-# Copyright 2012 Canonical
96-#
97-# This program is free software: you can redistribute it and/or modify it
98-# under the terms of the GNU Lesser General Public License version 3, as published
99-# by the Free Software Foundation.
100+#
101+# Copyright (C) 2012, 2013 Canonical Ltd.
102+#
103+# This program is free software; you can redistribute it and/or modify
104+# it under the terms of the GNU Lesser General Public License as published by
105+# the Free Software Foundation; version 3.
106+#
107+# This program is distributed in the hope that it will be useful,
108+# but WITHOUT ANY WARRANTY; without even the implied warranty of
109+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110+# GNU Lesser General Public License for more details.
111+#
112+# You should have received a copy of the GNU Lesser General Public License
113+# along with this program. If not, see <http://www.gnu.org/licenses/>.
114
115 """Ubuntu UI Toolkit autopilot tests."""
116
117@@ -20,6 +29,7 @@
118
119 from UbuntuUiToolkit.emulators.main_window import MainWindow
120
121+
122 def get_module_include_path():
123 return os.path.abspath(
124 os.path.join(
125@@ -29,22 +39,22 @@
126 '..',
127 '..',
128 'modules')
129- )
130+ )
131
132
133 class UbuntuUiToolkitTestCase(AutopilotTestCase):
134
135- """A common test case class that provides several useful methods for SDK tests."""
136+ """Common test case class for SDK tests."""
137
138 if model() == 'Desktop':
139 scenarios = [
140- ('with mouse', dict(input_device_class=Mouse))
141+ ('with mouse', dict(input_device_class=Mouse))
142 ]
143 else:
144 scenarios = [
145- ('with touch', dict(input_device_class=Touch))
146+ ('with touch', dict(input_device_class=Touch))
147 ]
148-
149+
150 def setUp(self):
151 self.pointing_device = Pointer(self.input_device_class.create())
152 super(UbuntuUiToolkitTestCase, self).setUp()
153@@ -54,8 +64,8 @@
154 # If the test class has defined a 'test_qml' class attribute then we
155 # write it to disk and launch it inside the Qml Viewer. If not, then we
156 # silently do nothing (presumably the test has something else planned).
157- arch = subprocess.check_output(["dpkg-architecture",
158- "-qDEB_HOST_MULTIARCH"]).strip()
159+ arch = subprocess.check_output(
160+ ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"]).strip()
161 if hasattr(self, 'test_qml') and isinstance(self.test_qml, basestring):
162 qml_path = mktemp(suffix='.qml')
163 open(qml_path, 'w').write(self.test_qml)
164@@ -66,37 +76,40 @@
165 "-I", get_module_include_path(),
166 qml_path)
167
168- if hasattr(self, 'test_qml_file') and isinstance(self.test_qml_file, basestring):
169+ if (hasattr(self, 'test_qml_file') and
170+ isinstance(self.test_qml_file, basestring)):
171 qml_path = self.test_qml_file
172 self.app = self.launch_test_application(
173 "/usr/lib/" + arch + "/qt5/bin/qmlscene",
174 "-I", get_module_include_path(),
175 qml_path)
176
177- self.assertThat(self.main_window.get_qml_view().visible,
178- Eventually(Equals(True)))
179+ self.assertThat(
180+ self.main_window.get_qml_view().visible, Eventually(Equals(True)))
181
182 def checkListItem(self, itemText):
183 item = self.main_window.get_object_by_text("Standard", itemText)
184- self.assertThat(item, Not(Is(None)));
185+ self.assertThat(item, Not(Is(None)))
186
187 def getListItem(self, itemText):
188 return self.main_window.get_object_by_text("Standard", itemText)
189
190 def getWidgetLoaderAndListView(self):
191- contentLoader = self.main_window.get_object("QQuickLoader", "contentLoader")
192+ contentLoader = self.main_window.get_object(
193+ "QQuickLoader", "contentLoader")
194 listView = self.main_window.get_object("QQuickListView", "widgetList")
195- self.assertThat(listView, Not(Is(None)));
196- self.assertThat(listView.visible, Eventually(Equals(True)));
197+ self.assertThat(listView, Not(Is(None)))
198+ self.assertThat(listView.visible, Eventually(Equals(True)))
199 return (contentLoader, listView)
200
201 def loadItem(self, item):
202- contentLoader = self.main_window.get_object("QQuickLoader", "contentLoader")
203+ contentLoader = self.main_window.get_object(
204+ "QQuickLoader", "contentLoader")
205 self.selectItem(item)
206- self.assertThat(contentLoader.progress,Eventually(Equals(1.0)))
207+ self.assertThat(contentLoader.progress, Eventually(Equals(1.0)))
208 loadedPage = self.main_window.get_object_by_text("Standard", item)
209- self.assertThat(loadedPage, Not(Is(None)));
210- self.assertThat(loadedPage.visible, Eventually(Equals(True)));
211+ self.assertThat(loadedPage, Not(Is(None)))
212+ self.assertThat(loadedPage.visible, Eventually(Equals(True)))
213
214 def drag(self, itemText, itemTextTo):
215 item = self.getListItem(itemText)
216@@ -118,37 +131,38 @@
217
218 def getMainView(self):
219 mainView = self.app.select_many("MainView")[0]
220- self.assertThat(mainView, Not(Is(None)));
221+ self.assertThat(mainView, Not(Is(None)))
222 return mainView
223
224 def getOrientationHelper(self):
225- orientationHelper = self.getMainView().select_many("OrientationHelper")[0]
226- self.assertThat(orientationHelper, Not(Is(None)));
227+ orientationHelper = self.getMainView().select_many(
228+ "OrientationHelper")[0]
229+ self.assertThat(orientationHelper, Not(Is(None)))
230 return orientationHelper
231
232- def checkPageHeader(self,pageTitle):
233- orientationHelper = self.getOrientationHelper();
234- header = orientationHelper.select_many("Header",title=pageTitle)[0]
235- self.assertThat(header, Not(Is(None)));
236+ def checkPageHeader(self, pageTitle):
237+ orientationHelper = self.getOrientationHelper()
238+ header = orientationHelper.select_many("Header", title=pageTitle)[0]
239+ self.assertThat(header, Not(Is(None)))
240 return header
241
242- def getObject(self,objectName):
243+ def getObject(self, objectName):
244 obj = self.app.select_single(objectName=objectName)
245- self.assertThat(obj, Not(Is(None)));
246+ self.assertThat(obj, Not(Is(None)))
247 return obj
248
249- def tap(self,objectName):
250+ def tap(self, objectName):
251 obj = self.getObject(objectName)
252 self.pointing_device.move_to_object(obj)
253 self.pointing_device.click()
254
255- def mousePress(self,objectName):
256+ def mousePress(self, objectName):
257 obj = self.getObject(objectName)
258 self.pointing_device.move_to_object(obj)
259 self.pointing_device.press()
260
261 def mouseRelease(self):
262- self.pointing_device.release()
263+ self.pointing_device.release()
264
265 def type_string(self, string):
266 self.keyboard.type(string)
267@@ -156,9 +170,9 @@
268 def type_key(self, key):
269 self.keyboard.key(key)
270
271- def tap_clearButton(self,objectName):
272+ def tap_clearButton(self, objectName):
273 textField = self.getObject(objectName)
274- self.assertThat(textField.hasClearButton, Equals(True));
275+ self.assertThat(textField.hasClearButton, Equals(True))
276 btn = textField.select_single("AbstractButton")
277 self.pointing_device.move_to_object(btn)
278 self.pointing_device.click()
279@@ -166,4 +180,3 @@
280 @property
281 def main_window(self):
282 return MainWindow(self.app)
283-
284
285=== modified file 'tests/autopilot/UbuntuUiToolkit/tests/gallery/__init__.py'
286--- tests/autopilot/UbuntuUiToolkit/tests/gallery/__init__.py 2013-07-03 17:03:25 +0000
287+++ tests/autopilot/UbuntuUiToolkit/tests/gallery/__init__.py 2013-07-12 04:03:28 +0000
288@@ -1,9 +1,17 @@
289 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
290-# Copyright 2012 Canonical
291-#
292-# This program is free software: you can redistribute it and/or modify it
293-# under the terms of the GNU Lesser General Public License version 3, as published
294-# by the Free Software Foundation.
295-
296+#
297+# Copyright (C) 2012, 2013 Canonical Ltd.
298+#
299+# This program is free software; you can redistribute it and/or modify
300+# it under the terms of the GNU Lesser General Public License as published by
301+# the Free Software Foundation; version 3.
302+#
303+# This program is distributed in the hope that it will be useful,
304+# but WITHOUT ANY WARRANTY; without even the implied warranty of
305+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
306+# GNU Lesser General Public License for more details.
307+#
308+# You should have received a copy of the GNU Lesser General Public License
309+# along with this program. If not, see <http://www.gnu.org/licenses/>.
310
311 """Tests for the Ubuntu UI Toolkit Gallery"""
312
313=== modified file 'tests/autopilot/UbuntuUiToolkit/tests/gallery/test_gallery.py'
314--- tests/autopilot/UbuntuUiToolkit/tests/gallery/test_gallery.py 2013-07-03 18:38:13 +0000
315+++ tests/autopilot/UbuntuUiToolkit/tests/gallery/test_gallery.py 2013-07-12 04:03:28 +0000
316@@ -1,9 +1,18 @@
317 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
318-# Copyright 2012 Canonical
319-#
320-# This program is free software: you can redistribute it and/or modify it
321-# under the terms of the GNU Lesser General Public License version 3, as published
322-# by the Free Software Foundation.
323+#
324+# Copyright (C) 2012, 2013 Canonical Ltd.
325+#
326+# This program is free software; you can redistribute it and/or modify
327+# it under the terms of the GNU Lesser General Public License as published by
328+# the Free Software Foundation; version 3.
329+#
330+# This program is distributed in the hope that it will be useful,
331+# but WITHOUT ANY WARRANTY; without even the implied warranty of
332+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
333+# GNU Lesser General Public License for more details.
334+#
335+# You should have received a copy of the GNU Lesser General Public License
336+# along with this program. If not, see <http://www.gnu.org/licenses/>.
337
338 """Tests for the Ubuntu UI Toolkit Gallery"""
339
340@@ -22,40 +31,45 @@
341
342 # Support both running from system and in the source directory
343 runPath = os.path.dirname(os.path.realpath(__file__))
344- localSourceFile = runPath + "/../../../../../examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml"
345+ localSourceFile = (
346+ runPath +
347+ "/../../../../../examples/ubuntu-ui-toolkit-gallery/"
348+ "ubuntu-ui-toolkit-gallery.qml")
349 if (os.path.isfile(localSourceFile)):
350 print "Using local source directory"
351 test_qml_file = localSourceFile
352 else:
353 print "Using system QML file"
354- test_qml_file = "/usr/lib/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml"
355+ test_qml_file = (
356+ "/usr/lib/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery/"
357+ "ubuntu-ui-toolkit-gallery.qml")
358
359 def test_0_can_select_mainwindow(self):
360 """Must be able to select the main window."""
361
362 rootItem = self.main_window.get_qml_view()
363 self.assertThat(rootItem, Not(Is(None)))
364- self.assertThat(rootItem.visible,Eventually(Equals(True)))
365+ self.assertThat(rootItem.visible, Eventually(Equals(True)))
366
367 def test_can_select_listview(self):
368- """Must be able to select the listview from main"""
369-
370- contentLoader,listView = self.getWidgetLoaderAndListView();
371-
372- # Don't have the first, already selected item as the first item to check
373+ """Must be able to select the listview from main"""
374+
375+ contentLoader, listView = self.getWidgetLoaderAndListView()
376+
377+ # Don't have the first, already selected item as the first item to
378+ # check.
379 items = [
380- "Navigation",
381- "Toggles",
382- "Buttons",
383- "Slider",
384- "Text Field",
385- "Progress and activity",
386- "Ubuntu Shape",
387- "Icons",
388- "Label",
389- "List Items",
390- ]
391-
392+ "Navigation",
393+ "Toggles",
394+ "Buttons",
395+ "Slider",
396+ "Text Field",
397+ "Progress and activity",
398+ "Ubuntu Shape",
399+ "Icons",
400+ "Label",
401+ "List Items",
402+ ]
403
404 for item in items:
405 self.checkListItem(item)
406@@ -63,20 +77,20 @@
407 self.checkPageHeader(item)
408
409 # scroll view to expose more items
410- self.drag("Icons","Text Field")
411+ self.drag("Icons", "Text Field")
412
413- # Wait for the scrolling to finish, the next click fails on the
414+ # Wait for the scrolling to finish, the next click fails on the
415 # slower Intel machine but succeeds on AMD and NVIDIA.
416 # (LP: #1180226)
417 time.sleep(1)
418
419 # now that we have more items, lets continue
420 items = [
421- "Dialog",
422- "Popover",
423- "Sheet",
424- "Animations"
425- ]
426+ "Dialog",
427+ "Popover",
428+ "Sheet",
429+ "Animations"
430+ ]
431
432 for item in items:
433 self.checkListItem(item)
434@@ -96,14 +110,14 @@
435
436 # check default states
437 item_data = [
438- ["checkbox_unchecked",False,True],
439- ["checkbox_checked",True,True],
440- ["checkbox_disabled_unchecked",False,False],
441- ["checkbox_disabled_checked",True,False],
442- ["switch_unchecked",False,True],
443- ["switch_checked",True,True],
444- ["switch_disabled_unchecked",False,False],
445- ["switch_disabled_checked",True,False]
446+ ["checkbox_unchecked", False, True],
447+ ["checkbox_checked", True, True],
448+ ["checkbox_disabled_unchecked", False, False],
449+ ["checkbox_disabled_checked", True, False],
450+ ["switch_unchecked", False, True],
451+ ["switch_checked", True, True],
452+ ["switch_disabled_unchecked", False, False],
453+ ["switch_disabled_checked", True, False]
454 ]
455
456 for data in item_data:
457@@ -114,7 +128,7 @@
458 obj = self.getObject(objName)
459 self.assertThat(obj.checked, Equals(objChecked))
460 self.assertThat(obj.enabled, Equals(objEnabled))
461-
462+
463 # try to interact with objects
464 self.tap(objName)
465
466@@ -129,12 +143,12 @@
467 self.checkPageHeader(item)
468
469 item_data = [
470- ["button_text",True,None,None,"Call"],
471- ["button_text_disabled",False,None,None,"Call"],
472- ["button_color",True,[0,0,0,255],None,"Call"],
473- ["button_iconsource",True,None,"call.png",None],
474- ["button_iconsource_right_text",True,None,"call.png","Call"],
475- ["button_iconsource_left_text",True,None,"call.png","Call"]
476+ ["button_text", True, None, None, "Call"],
477+ ["button_text_disabled", False, None, None, "Call"],
478+ ["button_color", True, [0, 0, 0, 255], None, "Call"],
479+ ["button_iconsource", True, None, "call.png", None],
480+ ["button_iconsource_right_text", True, None, "call.png", "Call"],
481+ ["button_iconsource_left_text", True, None, "call.png", "Call"]
482 ]
483
484 for data in item_data:
485@@ -148,15 +162,15 @@
486 self.assertThat(obj.enabled, Equals(objEnabled))
487
488 print obj.color
489- if (objColor != None):
490+ if (objColor is not None):
491 self.assertThat(obj.color, Equals(objColor))
492
493- if (objIcon != None):
494+ if (objIcon is not None):
495 self.assertThat(obj.iconSource.endswith(objIcon), Equals(True))
496
497- if (objText != None):
498+ if (objText is not None):
499 self.assertThat(obj.text, Equals(objText))
500-
501+
502 # try to interact with objects
503 self.mousePress(objName)
504
505@@ -168,16 +182,16 @@
506 self.mouseRelease()
507
508 self.assertThat(obj.pressed, Equals(False))
509-
510+
511 def test_slider(self):
512 item = "Slider"
513 self.loadItem(item)
514 self.checkPageHeader(item)
515
516 item_data = [
517- [ "slider_standard" ],
518- [ "slider_live" ],
519- [ "slider_range" ]
520+ ["slider_standard"],
521+ ["slider_live"],
522+ ["slider_range"]
523 ]
524
525 for data in item_data:
526@@ -186,18 +200,18 @@
527 self.tap(objName)
528
529 # TODO: move slider value
530-
531+
532 # def test_textarea(self):
533 # item = "Text Field"
534 # self.loadItem(item)
535 # self.checkPageHeader(item)
536
537 # template_textinputs = self.getObject("textinputs")
538-
539+
540 # item_data = [
541-# [ "textarea_default", True, -1, template_textinputs.longText, None ],
542+# ["textarea_default", True, -1, template_textinputs.longText, None ],
543 # [ "textarea_expanding", True, -1, "", None],
544-# [ "textarea_richtext", True, -1, template_textinputs.richText, None ]
545+# [ "textarea_richtext", True, -1, template_textinputs.richText, None ]
546 # ]
547
548 # for data in item_data:
549@@ -211,7 +225,7 @@
550 # self.tap(objName)
551
552 # self.assertThat(obj.enabled, Equals(objEnabled))
553-# # self.assertThat(obj.focus, Equals(obj.enabled))
554+# # self.assertThat(obj.focus, Equals(obj.enabled))
555 # self.assertThat(obj.highlighted, Equals(obj.focus))
556 # #self.assertThat(obj.hasClearButton, Equals(True))
557 # self.assertThat(obj.text, Equals(objText))
558@@ -225,21 +239,18 @@
559
560 # self.assertThat(obj.text,Equals("Hello World!"))
561
562-
563-
564-
565 def test_textfield(self):
566 item = "Text Field"
567 self.loadItem(item)
568 self.checkPageHeader(item)
569
570 template_textinputs = self.getObject("textinputs")
571-
572+
573 item_data = [
574- [ "textfield_standard", True, 0, "", None ],
575- [ "textfield_password", True, 2, "password", None ],
576- [ "textfield_numbers", True, 0, "123", True ],
577- [ "textfield_disabled", False, 0, "", None ],
578+ ["textfield_standard", True, 0, "", None],
579+ ["textfield_password", True, 2, "password", None],
580+ ["textfield_numbers", True, 0, "123", True],
581+ ["textfield_disabled", False, 0, "", None],
582 ]
583
584 for data in item_data:
585@@ -253,25 +264,26 @@
586 self.tap(objName)
587
588 self.assertThat(obj.enabled, Equals(objEnabled))
589- self.assertThat(obj.focus, Equals(obj.enabled))
590+ self.assertThat(obj.focus, Equals(obj.enabled))
591 self.assertThat(obj.highlighted, Equals(obj.focus))
592 self.assertThat(obj.errorHighlight, Equals(False))
593 self.assertThat(obj.acceptableInput, Equals(True))
594 self.assertThat(obj.hasClearButton, Equals(True))
595 self.assertThat(obj.text, Equals(objText))
596
597- if (objEchoMode!=-1):
598+ if (objEchoMode != -1):
599 self.assertThat(obj.echoMode, Equals(objEchoMode))
600-
601+
602 if (objNumbersOnly):
603 self.type_string("abc")
604- self.assertThat(obj.text,Equals(objText))
605+ self.assertThat(obj.text, Equals(objText))
606 self.assertThat(obj.errorHighlight, Equals(False))
607 self.assertThat(obj.acceptableInput, Equals(True))
608 else:
609 self.type_string("Hello World!")
610 if (objEnabled):
611- self.assertThat(obj.text, Equals("%sHello World!" % (objText)))
612+ self.assertThat(
613+ obj.text, Equals("%sHello World!" % (objText)))
614 self.assertThat(obj.errorHighlight, Equals(False))
615 self.assertThat(obj.acceptableInput, Equals(True))
616 else:
617@@ -279,18 +291,15 @@
618
619 self.tap_clearButton(objName)
620
621-
622-
623-
624 def test_progress_and_activity(self):
625 item = "Progress and activity"
626 self.loadItem(item)
627 self.checkPageHeader(item)
628
629 item_data = [
630- [ "progressbar_standard" ],
631- [ "progressbar_indeterminate" ],
632- [ "activityindicator_standard" ]
633+ ["progressbar_standard"],
634+ ["progressbar_indeterminate"],
635+ ["activityindicator_standard"]
636 ]
637
638 for data in item_data:
639@@ -299,7 +308,6 @@
640 self.tap(objName)
641
642 # TODO: check for properties
643-
644
645 def test_ubuntushape(self):
646 item = "Ubuntu Shape"
647@@ -307,18 +315,16 @@
648 self.checkPageHeader(item)
649
650 item_data = [
651- [ "ubuntushape_color_hex" ],
652- [ "ubuntushape_color_lightblue" ],
653- [ "ubuntushape_color_darkgray" ],
654- [ "ubuntushape_image" ],
655- [ "ubuntushape_radius_small" ],
656- [ "ubuntushape_radius_medium" ],
657- [ "ubuntushape_sizes_15_6" ],
658- [ "ubuntushape_sizes_10_14" ]
659+ ["ubuntushape_color_hex"],
660+ ["ubuntushape_color_lightblue"],
661+ ["ubuntushape_color_darkgray"],
662+ ["ubuntushape_image"],
663+ ["ubuntushape_radius_small"],
664+ ["ubuntushape_radius_medium"],
665+ ["ubuntushape_sizes_15_6"],
666+ ["ubuntushape_sizes_10_14"]
667 ]
668
669 for data in item_data:
670 objName = data[0]
671 obj = self.getObject(objName)
672-
673-

Subscribers

People subscribed via source and target branches

to status/vote changes: