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
=== modified file 'tests/autopilot/UbuntuUiToolkit/__init__.py'
--- tests/autopilot/UbuntuUiToolkit/__init__.py 2013-07-03 17:03:25 +0000
+++ tests/autopilot/UbuntuUiToolkit/__init__.py 2013-07-12 04:03:28 +0000
@@ -1,8 +1,17 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2012 Canonical2#
3#3# Copyright (C) 2012, 2013 Canonical Ltd.
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU Lesser General Public License version 3, as published5# This program is free software; you can redistribute it and/or modify
6# by the Free Software Foundation.6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
716
8"""Ubuntu UI Toolkit autopilot tests and emulators - top level package."""17"""Ubuntu UI Toolkit autopilot tests and emulators - top level package."""
918
=== modified file 'tests/autopilot/UbuntuUiToolkit/emulators/__init__.py'
--- tests/autopilot/UbuntuUiToolkit/emulators/__init__.py 2013-07-03 17:03:25 +0000
+++ tests/autopilot/UbuntuUiToolkit/emulators/__init__.py 2013-07-12 04:03:28 +0000
@@ -1,6 +1,15 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2012 Canonical2#
3#3# Copyright (C) 2012, 2013 Canonical Ltd.
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU General Public License version 3, as published5# This program is free software; you can redistribute it and/or modify
6# by the Free Software Foundation.6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
716
=== modified file 'tests/autopilot/UbuntuUiToolkit/emulators/main_window.py'
--- tests/autopilot/UbuntuUiToolkit/emulators/main_window.py 2013-07-05 07:14:36 +0000
+++ tests/autopilot/UbuntuUiToolkit/emulators/main_window.py 2013-07-12 04:03:28 +0000
@@ -1,9 +1,19 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2013 Canonical2#
3#3# Copyright (C) 2013 Canonical Ltd.
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU General Public License version 3, as published5# This program is free software; you can redistribute it and/or modify
6# by the Free Software Foundation.6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
717
8class MainWindow(object):18class MainWindow(object):
9 """An emulator class that makes it easy to interact with the camera-app."""19 """An emulator class that makes it easy to interact with the camera-app."""
@@ -17,6 +27,6 @@
1727
18 def get_object(self, typeName, name):28 def get_object(self, typeName, name):
19 return self.app.select_single(typeName, objectName=name)29 return self.app.select_single(typeName, objectName=name)
20 30
21 def get_object_by_text(self, typeName, itemText):31 def get_object_by_text(self, typeName, itemText):
22 return self.app.select_single(typeName, text=itemText)32 return self.app.select_single(typeName, text=itemText)
2333
=== modified file 'tests/autopilot/UbuntuUiToolkit/tests/__init__.py'
--- tests/autopilot/UbuntuUiToolkit/tests/__init__.py 2013-07-03 17:03:25 +0000
+++ tests/autopilot/UbuntuUiToolkit/tests/__init__.py 2013-07-12 04:03:28 +0000
@@ -1,9 +1,18 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2012 Canonical2#
3#3# Copyright (C) 2012, 2013 Canonical Ltd.
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU Lesser General Public License version 3, as published5# This program is free software; you can redistribute it and/or modify
6# by the Free Software Foundation.6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
716
8"""Ubuntu UI Toolkit autopilot tests."""17"""Ubuntu UI Toolkit autopilot tests."""
918
@@ -20,6 +29,7 @@
2029
21from UbuntuUiToolkit.emulators.main_window import MainWindow30from UbuntuUiToolkit.emulators.main_window import MainWindow
2231
32
23def get_module_include_path():33def get_module_include_path():
24 return os.path.abspath(34 return os.path.abspath(
25 os.path.join(35 os.path.join(
@@ -29,22 +39,22 @@
29 '..',39 '..',
30 '..',40 '..',
31 'modules')41 'modules')
32 )42 )
3343
3444
35class UbuntuUiToolkitTestCase(AutopilotTestCase):45class UbuntuUiToolkitTestCase(AutopilotTestCase):
3646
37 """A common test case class that provides several useful methods for SDK tests."""47 """Common test case class for SDK tests."""
3848
39 if model() == 'Desktop':49 if model() == 'Desktop':
40 scenarios = [50 scenarios = [
41 ('with mouse', dict(input_device_class=Mouse))51 ('with mouse', dict(input_device_class=Mouse))
42 ]52 ]
43 else:53 else:
44 scenarios = [54 scenarios = [
45 ('with touch', dict(input_device_class=Touch))55 ('with touch', dict(input_device_class=Touch))
46 ]56 ]
47 57
48 def setUp(self):58 def setUp(self):
49 self.pointing_device = Pointer(self.input_device_class.create())59 self.pointing_device = Pointer(self.input_device_class.create())
50 super(UbuntuUiToolkitTestCase, self).setUp()60 super(UbuntuUiToolkitTestCase, self).setUp()
@@ -54,8 +64,8 @@
54 # If the test class has defined a 'test_qml' class attribute then we64 # If the test class has defined a 'test_qml' class attribute then we
55 # write it to disk and launch it inside the Qml Viewer. If not, then we65 # write it to disk and launch it inside the Qml Viewer. If not, then we
56 # silently do nothing (presumably the test has something else planned).66 # silently do nothing (presumably the test has something else planned).
57 arch = subprocess.check_output(["dpkg-architecture",67 arch = subprocess.check_output(
58 "-qDEB_HOST_MULTIARCH"]).strip()68 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"]).strip()
59 if hasattr(self, 'test_qml') and isinstance(self.test_qml, basestring):69 if hasattr(self, 'test_qml') and isinstance(self.test_qml, basestring):
60 qml_path = mktemp(suffix='.qml')70 qml_path = mktemp(suffix='.qml')
61 open(qml_path, 'w').write(self.test_qml)71 open(qml_path, 'w').write(self.test_qml)
@@ -66,37 +76,40 @@
66 "-I", get_module_include_path(),76 "-I", get_module_include_path(),
67 qml_path)77 qml_path)
6878
69 if hasattr(self, 'test_qml_file') and isinstance(self.test_qml_file, basestring):79 if (hasattr(self, 'test_qml_file') and
80 isinstance(self.test_qml_file, basestring)):
70 qml_path = self.test_qml_file81 qml_path = self.test_qml_file
71 self.app = self.launch_test_application(82 self.app = self.launch_test_application(
72 "/usr/lib/" + arch + "/qt5/bin/qmlscene",83 "/usr/lib/" + arch + "/qt5/bin/qmlscene",
73 "-I", get_module_include_path(),84 "-I", get_module_include_path(),
74 qml_path)85 qml_path)
7586
76 self.assertThat(self.main_window.get_qml_view().visible,87 self.assertThat(
77 Eventually(Equals(True)))88 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
7889
79 def checkListItem(self, itemText):90 def checkListItem(self, itemText):
80 item = self.main_window.get_object_by_text("Standard", itemText)91 item = self.main_window.get_object_by_text("Standard", itemText)
81 self.assertThat(item, Not(Is(None)));92 self.assertThat(item, Not(Is(None)))
8293
83 def getListItem(self, itemText):94 def getListItem(self, itemText):
84 return self.main_window.get_object_by_text("Standard", itemText)95 return self.main_window.get_object_by_text("Standard", itemText)
8596
86 def getWidgetLoaderAndListView(self):97 def getWidgetLoaderAndListView(self):
87 contentLoader = self.main_window.get_object("QQuickLoader", "contentLoader")98 contentLoader = self.main_window.get_object(
99 "QQuickLoader", "contentLoader")
88 listView = self.main_window.get_object("QQuickListView", "widgetList")100 listView = self.main_window.get_object("QQuickListView", "widgetList")
89 self.assertThat(listView, Not(Is(None)));101 self.assertThat(listView, Not(Is(None)))
90 self.assertThat(listView.visible, Eventually(Equals(True)));102 self.assertThat(listView.visible, Eventually(Equals(True)))
91 return (contentLoader, listView)103 return (contentLoader, listView)
92104
93 def loadItem(self, item):105 def loadItem(self, item):
94 contentLoader = self.main_window.get_object("QQuickLoader", "contentLoader")106 contentLoader = self.main_window.get_object(
107 "QQuickLoader", "contentLoader")
95 self.selectItem(item)108 self.selectItem(item)
96 self.assertThat(contentLoader.progress,Eventually(Equals(1.0)))109 self.assertThat(contentLoader.progress, Eventually(Equals(1.0)))
97 loadedPage = self.main_window.get_object_by_text("Standard", item)110 loadedPage = self.main_window.get_object_by_text("Standard", item)
98 self.assertThat(loadedPage, Not(Is(None)));111 self.assertThat(loadedPage, Not(Is(None)))
99 self.assertThat(loadedPage.visible, Eventually(Equals(True))); 112 self.assertThat(loadedPage.visible, Eventually(Equals(True)))
100113
101 def drag(self, itemText, itemTextTo):114 def drag(self, itemText, itemTextTo):
102 item = self.getListItem(itemText)115 item = self.getListItem(itemText)
@@ -118,37 +131,38 @@
118131
119 def getMainView(self):132 def getMainView(self):
120 mainView = self.app.select_many("MainView")[0]133 mainView = self.app.select_many("MainView")[0]
121 self.assertThat(mainView, Not(Is(None)));134 self.assertThat(mainView, Not(Is(None)))
122 return mainView135 return mainView
123136
124 def getOrientationHelper(self):137 def getOrientationHelper(self):
125 orientationHelper = self.getMainView().select_many("OrientationHelper")[0]138 orientationHelper = self.getMainView().select_many(
126 self.assertThat(orientationHelper, Not(Is(None)));139 "OrientationHelper")[0]
140 self.assertThat(orientationHelper, Not(Is(None)))
127 return orientationHelper141 return orientationHelper
128142
129 def checkPageHeader(self,pageTitle):143 def checkPageHeader(self, pageTitle):
130 orientationHelper = self.getOrientationHelper();144 orientationHelper = self.getOrientationHelper()
131 header = orientationHelper.select_many("Header",title=pageTitle)[0]145 header = orientationHelper.select_many("Header", title=pageTitle)[0]
132 self.assertThat(header, Not(Is(None)));146 self.assertThat(header, Not(Is(None)))
133 return header147 return header
134148
135 def getObject(self,objectName):149 def getObject(self, objectName):
136 obj = self.app.select_single(objectName=objectName)150 obj = self.app.select_single(objectName=objectName)
137 self.assertThat(obj, Not(Is(None)));151 self.assertThat(obj, Not(Is(None)))
138 return obj152 return obj
139153
140 def tap(self,objectName):154 def tap(self, objectName):
141 obj = self.getObject(objectName)155 obj = self.getObject(objectName)
142 self.pointing_device.move_to_object(obj)156 self.pointing_device.move_to_object(obj)
143 self.pointing_device.click()157 self.pointing_device.click()
144158
145 def mousePress(self,objectName):159 def mousePress(self, objectName):
146 obj = self.getObject(objectName)160 obj = self.getObject(objectName)
147 self.pointing_device.move_to_object(obj)161 self.pointing_device.move_to_object(obj)
148 self.pointing_device.press()162 self.pointing_device.press()
149163
150 def mouseRelease(self):164 def mouseRelease(self):
151 self.pointing_device.release() 165 self.pointing_device.release()
152166
153 def type_string(self, string):167 def type_string(self, string):
154 self.keyboard.type(string)168 self.keyboard.type(string)
@@ -156,9 +170,9 @@
156 def type_key(self, key):170 def type_key(self, key):
157 self.keyboard.key(key)171 self.keyboard.key(key)
158172
159 def tap_clearButton(self,objectName):173 def tap_clearButton(self, objectName):
160 textField = self.getObject(objectName)174 textField = self.getObject(objectName)
161 self.assertThat(textField.hasClearButton, Equals(True));175 self.assertThat(textField.hasClearButton, Equals(True))
162 btn = textField.select_single("AbstractButton")176 btn = textField.select_single("AbstractButton")
163 self.pointing_device.move_to_object(btn)177 self.pointing_device.move_to_object(btn)
164 self.pointing_device.click()178 self.pointing_device.click()
@@ -166,4 +180,3 @@
166 @property180 @property
167 def main_window(self):181 def main_window(self):
168 return MainWindow(self.app)182 return MainWindow(self.app)
169
170183
=== modified file 'tests/autopilot/UbuntuUiToolkit/tests/gallery/__init__.py'
--- tests/autopilot/UbuntuUiToolkit/tests/gallery/__init__.py 2013-07-03 17:03:25 +0000
+++ tests/autopilot/UbuntuUiToolkit/tests/gallery/__init__.py 2013-07-12 04:03:28 +0000
@@ -1,9 +1,17 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2012 Canonical2#
3#3# Copyright (C) 2012, 2013 Canonical Ltd.
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU Lesser General Public License version 3, as published5# This program is free software; you can redistribute it and/or modify
6# by the Free Software Foundation.6# it under the terms of the GNU Lesser General Public License as published by
77# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
816
9"""Tests for the Ubuntu UI Toolkit Gallery"""17"""Tests for the Ubuntu UI Toolkit Gallery"""
1018
=== modified file 'tests/autopilot/UbuntuUiToolkit/tests/gallery/test_gallery.py'
--- tests/autopilot/UbuntuUiToolkit/tests/gallery/test_gallery.py 2013-07-03 18:38:13 +0000
+++ tests/autopilot/UbuntuUiToolkit/tests/gallery/test_gallery.py 2013-07-12 04:03:28 +0000
@@ -1,9 +1,18 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2012 Canonical2#
3#3# Copyright (C) 2012, 2013 Canonical Ltd.
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU Lesser General Public License version 3, as published5# This program is free software; you can redistribute it and/or modify
6# by the Free Software Foundation.6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
716
8"""Tests for the Ubuntu UI Toolkit Gallery"""17"""Tests for the Ubuntu UI Toolkit Gallery"""
918
@@ -22,40 +31,45 @@
2231
23 # Support both running from system and in the source directory32 # Support both running from system and in the source directory
24 runPath = os.path.dirname(os.path.realpath(__file__))33 runPath = os.path.dirname(os.path.realpath(__file__))
25 localSourceFile = runPath + "/../../../../../examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml"34 localSourceFile = (
35 runPath +
36 "/../../../../../examples/ubuntu-ui-toolkit-gallery/"
37 "ubuntu-ui-toolkit-gallery.qml")
26 if (os.path.isfile(localSourceFile)):38 if (os.path.isfile(localSourceFile)):
27 print "Using local source directory"39 print "Using local source directory"
28 test_qml_file = localSourceFile40 test_qml_file = localSourceFile
29 else:41 else:
30 print "Using system QML file"42 print "Using system QML file"
31 test_qml_file = "/usr/lib/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml"43 test_qml_file = (
44 "/usr/lib/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery/"
45 "ubuntu-ui-toolkit-gallery.qml")
3246
33 def test_0_can_select_mainwindow(self):47 def test_0_can_select_mainwindow(self):
34 """Must be able to select the main window."""48 """Must be able to select the main window."""
3549
36 rootItem = self.main_window.get_qml_view()50 rootItem = self.main_window.get_qml_view()
37 self.assertThat(rootItem, Not(Is(None)))51 self.assertThat(rootItem, Not(Is(None)))
38 self.assertThat(rootItem.visible,Eventually(Equals(True)))52 self.assertThat(rootItem.visible, Eventually(Equals(True)))
3953
40 def test_can_select_listview(self):54 def test_can_select_listview(self):
41 """Must be able to select the listview from main""" 55 """Must be able to select the listview from main"""
4256
43 contentLoader,listView = self.getWidgetLoaderAndListView();57 contentLoader, listView = self.getWidgetLoaderAndListView()
4458
45 # Don't have the first, already selected item as the first item to check59 # Don't have the first, already selected item as the first item to
60 # check.
46 items = [61 items = [
47 "Navigation",62 "Navigation",
48 "Toggles", 63 "Toggles",
49 "Buttons", 64 "Buttons",
50 "Slider", 65 "Slider",
51 "Text Field", 66 "Text Field",
52 "Progress and activity", 67 "Progress and activity",
53 "Ubuntu Shape", 68 "Ubuntu Shape",
54 "Icons", 69 "Icons",
55 "Label",70 "Label",
56 "List Items", 71 "List Items",
57 ] 72 ]
58
5973
60 for item in items:74 for item in items:
61 self.checkListItem(item)75 self.checkListItem(item)
@@ -63,20 +77,20 @@
63 self.checkPageHeader(item)77 self.checkPageHeader(item)
6478
65 # scroll view to expose more items79 # scroll view to expose more items
66 self.drag("Icons","Text Field")80 self.drag("Icons", "Text Field")
6781
68 # Wait for the scrolling to finish, the next click fails on the 82 # Wait for the scrolling to finish, the next click fails on the
69 # slower Intel machine but succeeds on AMD and NVIDIA.83 # slower Intel machine but succeeds on AMD and NVIDIA.
70 # (LP: #1180226)84 # (LP: #1180226)
71 time.sleep(1)85 time.sleep(1)
7286
73 # now that we have more items, lets continue87 # now that we have more items, lets continue
74 items = [88 items = [
75 "Dialog", 89 "Dialog",
76 "Popover",90 "Popover",
77 "Sheet",91 "Sheet",
78 "Animations"92 "Animations"
79 ]93 ]
8094
81 for item in items:95 for item in items:
82 self.checkListItem(item)96 self.checkListItem(item)
@@ -96,14 +110,14 @@
96110
97 # check default states111 # check default states
98 item_data = [112 item_data = [
99 ["checkbox_unchecked",False,True],113 ["checkbox_unchecked", False, True],
100 ["checkbox_checked",True,True],114 ["checkbox_checked", True, True],
101 ["checkbox_disabled_unchecked",False,False],115 ["checkbox_disabled_unchecked", False, False],
102 ["checkbox_disabled_checked",True,False],116 ["checkbox_disabled_checked", True, False],
103 ["switch_unchecked",False,True],117 ["switch_unchecked", False, True],
104 ["switch_checked",True,True],118 ["switch_checked", True, True],
105 ["switch_disabled_unchecked",False,False],119 ["switch_disabled_unchecked", False, False],
106 ["switch_disabled_checked",True,False]120 ["switch_disabled_checked", True, False]
107 ]121 ]
108122
109 for data in item_data:123 for data in item_data:
@@ -114,7 +128,7 @@
114 obj = self.getObject(objName)128 obj = self.getObject(objName)
115 self.assertThat(obj.checked, Equals(objChecked))129 self.assertThat(obj.checked, Equals(objChecked))
116 self.assertThat(obj.enabled, Equals(objEnabled))130 self.assertThat(obj.enabled, Equals(objEnabled))
117 131
118 # try to interact with objects132 # try to interact with objects
119 self.tap(objName)133 self.tap(objName)
120134
@@ -129,12 +143,12 @@
129 self.checkPageHeader(item)143 self.checkPageHeader(item)
130144
131 item_data = [145 item_data = [
132 ["button_text",True,None,None,"Call"],146 ["button_text", True, None, None, "Call"],
133 ["button_text_disabled",False,None,None,"Call"],147 ["button_text_disabled", False, None, None, "Call"],
134 ["button_color",True,[0,0,0,255],None,"Call"],148 ["button_color", True, [0, 0, 0, 255], None, "Call"],
135 ["button_iconsource",True,None,"call.png",None],149 ["button_iconsource", True, None, "call.png", None],
136 ["button_iconsource_right_text",True,None,"call.png","Call"],150 ["button_iconsource_right_text", True, None, "call.png", "Call"],
137 ["button_iconsource_left_text",True,None,"call.png","Call"]151 ["button_iconsource_left_text", True, None, "call.png", "Call"]
138 ]152 ]
139153
140 for data in item_data:154 for data in item_data:
@@ -148,15 +162,15 @@
148 self.assertThat(obj.enabled, Equals(objEnabled))162 self.assertThat(obj.enabled, Equals(objEnabled))
149163
150 print obj.color164 print obj.color
151 if (objColor != None):165 if (objColor is not None):
152 self.assertThat(obj.color, Equals(objColor))166 self.assertThat(obj.color, Equals(objColor))
153167
154 if (objIcon != None):168 if (objIcon is not None):
155 self.assertThat(obj.iconSource.endswith(objIcon), Equals(True))169 self.assertThat(obj.iconSource.endswith(objIcon), Equals(True))
156170
157 if (objText != None):171 if (objText is not None):
158 self.assertThat(obj.text, Equals(objText))172 self.assertThat(obj.text, Equals(objText))
159 173
160 # try to interact with objects174 # try to interact with objects
161 self.mousePress(objName)175 self.mousePress(objName)
162176
@@ -168,16 +182,16 @@
168 self.mouseRelease()182 self.mouseRelease()
169183
170 self.assertThat(obj.pressed, Equals(False))184 self.assertThat(obj.pressed, Equals(False))
171 185
172 def test_slider(self):186 def test_slider(self):
173 item = "Slider"187 item = "Slider"
174 self.loadItem(item)188 self.loadItem(item)
175 self.checkPageHeader(item)189 self.checkPageHeader(item)
176190
177 item_data = [191 item_data = [
178 [ "slider_standard" ],192 ["slider_standard"],
179 [ "slider_live" ],193 ["slider_live"],
180 [ "slider_range" ]194 ["slider_range"]
181 ]195 ]
182196
183 for data in item_data:197 for data in item_data:
@@ -186,18 +200,18 @@
186 self.tap(objName)200 self.tap(objName)
187201
188 # TODO: move slider value202 # TODO: move slider value
189 203
190# def test_textarea(self):204# def test_textarea(self):
191# item = "Text Field"205# item = "Text Field"
192# self.loadItem(item)206# self.loadItem(item)
193# self.checkPageHeader(item)207# self.checkPageHeader(item)
194208
195# template_textinputs = self.getObject("textinputs")209# template_textinputs = self.getObject("textinputs")
196 210
197# item_data = [211# item_data = [
198# [ "textarea_default", True, -1, template_textinputs.longText, None ],212# ["textarea_default", True, -1, template_textinputs.longText, None ],
199# [ "textarea_expanding", True, -1, "", None],213# [ "textarea_expanding", True, -1, "", None],
200# [ "textarea_richtext", True, -1, template_textinputs.richText, None ]214# [ "textarea_richtext", True, -1, template_textinputs.richText, None ]
201# ]215# ]
202216
203# for data in item_data:217# for data in item_data:
@@ -211,7 +225,7 @@
211# self.tap(objName)225# self.tap(objName)
212226
213# self.assertThat(obj.enabled, Equals(objEnabled))227# self.assertThat(obj.enabled, Equals(objEnabled))
214# # self.assertThat(obj.focus, Equals(obj.enabled)) 228# # self.assertThat(obj.focus, Equals(obj.enabled))
215# self.assertThat(obj.highlighted, Equals(obj.focus))229# self.assertThat(obj.highlighted, Equals(obj.focus))
216# #self.assertThat(obj.hasClearButton, Equals(True))230# #self.assertThat(obj.hasClearButton, Equals(True))
217# self.assertThat(obj.text, Equals(objText))231# self.assertThat(obj.text, Equals(objText))
@@ -225,21 +239,18 @@
225239
226 # self.assertThat(obj.text,Equals("Hello World!"))240 # self.assertThat(obj.text,Equals("Hello World!"))
227241
228
229
230
231 def test_textfield(self):242 def test_textfield(self):
232 item = "Text Field"243 item = "Text Field"
233 self.loadItem(item)244 self.loadItem(item)
234 self.checkPageHeader(item)245 self.checkPageHeader(item)
235246
236 template_textinputs = self.getObject("textinputs")247 template_textinputs = self.getObject("textinputs")
237 248
238 item_data = [249 item_data = [
239 [ "textfield_standard", True, 0, "", None ],250 ["textfield_standard", True, 0, "", None],
240 [ "textfield_password", True, 2, "password", None ],251 ["textfield_password", True, 2, "password", None],
241 [ "textfield_numbers", True, 0, "123", True ],252 ["textfield_numbers", True, 0, "123", True],
242 [ "textfield_disabled", False, 0, "", None ],253 ["textfield_disabled", False, 0, "", None],
243 ]254 ]
244255
245 for data in item_data:256 for data in item_data:
@@ -253,25 +264,26 @@
253 self.tap(objName)264 self.tap(objName)
254265
255 self.assertThat(obj.enabled, Equals(objEnabled))266 self.assertThat(obj.enabled, Equals(objEnabled))
256 self.assertThat(obj.focus, Equals(obj.enabled)) 267 self.assertThat(obj.focus, Equals(obj.enabled))
257 self.assertThat(obj.highlighted, Equals(obj.focus))268 self.assertThat(obj.highlighted, Equals(obj.focus))
258 self.assertThat(obj.errorHighlight, Equals(False))269 self.assertThat(obj.errorHighlight, Equals(False))
259 self.assertThat(obj.acceptableInput, Equals(True))270 self.assertThat(obj.acceptableInput, Equals(True))
260 self.assertThat(obj.hasClearButton, Equals(True))271 self.assertThat(obj.hasClearButton, Equals(True))
261 self.assertThat(obj.text, Equals(objText))272 self.assertThat(obj.text, Equals(objText))
262273
263 if (objEchoMode!=-1):274 if (objEchoMode != -1):
264 self.assertThat(obj.echoMode, Equals(objEchoMode))275 self.assertThat(obj.echoMode, Equals(objEchoMode))
265 276
266 if (objNumbersOnly):277 if (objNumbersOnly):
267 self.type_string("abc")278 self.type_string("abc")
268 self.assertThat(obj.text,Equals(objText))279 self.assertThat(obj.text, Equals(objText))
269 self.assertThat(obj.errorHighlight, Equals(False))280 self.assertThat(obj.errorHighlight, Equals(False))
270 self.assertThat(obj.acceptableInput, Equals(True))281 self.assertThat(obj.acceptableInput, Equals(True))
271 else:282 else:
272 self.type_string("Hello World!")283 self.type_string("Hello World!")
273 if (objEnabled):284 if (objEnabled):
274 self.assertThat(obj.text, Equals("%sHello World!" % (objText)))285 self.assertThat(
286 obj.text, Equals("%sHello World!" % (objText)))
275 self.assertThat(obj.errorHighlight, Equals(False))287 self.assertThat(obj.errorHighlight, Equals(False))
276 self.assertThat(obj.acceptableInput, Equals(True))288 self.assertThat(obj.acceptableInput, Equals(True))
277 else:289 else:
@@ -279,18 +291,15 @@
279291
280 self.tap_clearButton(objName)292 self.tap_clearButton(objName)
281293
282
283
284
285 def test_progress_and_activity(self):294 def test_progress_and_activity(self):
286 item = "Progress and activity"295 item = "Progress and activity"
287 self.loadItem(item)296 self.loadItem(item)
288 self.checkPageHeader(item)297 self.checkPageHeader(item)
289298
290 item_data = [299 item_data = [
291 [ "progressbar_standard" ],300 ["progressbar_standard"],
292 [ "progressbar_indeterminate" ],301 ["progressbar_indeterminate"],
293 [ "activityindicator_standard" ]302 ["activityindicator_standard"]
294 ]303 ]
295304
296 for data in item_data:305 for data in item_data:
@@ -299,7 +308,6 @@
299 self.tap(objName)308 self.tap(objName)
300309
301 # TODO: check for properties310 # TODO: check for properties
302
303311
304 def test_ubuntushape(self):312 def test_ubuntushape(self):
305 item = "Ubuntu Shape"313 item = "Ubuntu Shape"
@@ -307,18 +315,16 @@
307 self.checkPageHeader(item)315 self.checkPageHeader(item)
308316
309 item_data = [317 item_data = [
310 [ "ubuntushape_color_hex" ],318 ["ubuntushape_color_hex"],
311 [ "ubuntushape_color_lightblue" ],319 ["ubuntushape_color_lightblue"],
312 [ "ubuntushape_color_darkgray" ],320 ["ubuntushape_color_darkgray"],
313 [ "ubuntushape_image" ],321 ["ubuntushape_image"],
314 [ "ubuntushape_radius_small" ],322 ["ubuntushape_radius_small"],
315 [ "ubuntushape_radius_medium" ],323 ["ubuntushape_radius_medium"],
316 [ "ubuntushape_sizes_15_6" ],324 ["ubuntushape_sizes_15_6"],
317 [ "ubuntushape_sizes_10_14" ]325 ["ubuntushape_sizes_10_14"]
318 ]326 ]
319327
320 for data in item_data:328 for data in item_data:
321 objName = data[0]329 objName = data[0]
322 obj = self.getObject(objName)330 obj = self.getObject(objName)
323
324

Subscribers

People subscribed via source and target branches

to status/vote changes: