Merge lp:~barry/mediaplayer-app/py3autopilot into lp:mediaplayer-app

Proposed by Barry Warsaw
Status: Superseded
Proposed branch: lp:~barry/mediaplayer-app/py3autopilot
Merge into: lp:mediaplayer-app
Diff against target: 270 lines (+42/-44)
7 files modified
debian/changelog (+7/-0)
debian/control (+3/-3)
tests/autopilot/CMakeLists.txt (+1/-1)
tests/autopilot/mediaplayer_app/emulators/main_window.py (+3/-3)
tests/autopilot/mediaplayer_app/tests/__init__.py (+0/-1)
tests/autopilot/mediaplayer_app/tests/test_player.py (+1/-7)
tests/autopilot/mediaplayer_app/tests/test_player_with_video.py (+27/-29)
To merge this branch: bzr merge lp:~barry/mediaplayer-app/py3autopilot
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+222548@code.launchpad.net

This proposal has been superseded by a proposal from 2014-07-15.

Commit message

* Port autopilot tests to Python 3.
* Bump Standards-Version to 3.9.5.

Description of the change

  * Port autopilot tests to Python 3.
  * Bump Standards-Version to 3.9.5.

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

I've kicked a new jenkins run to see what's the status of this branch.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
236. By Barry Warsaw

trunk merge

237. By Barry Warsaw

Pre-requisite branch merge.

238. By Barry Warsaw

merge trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-05-09 16:12:00 +0000
3+++ debian/changelog 2014-06-09 19:48:39 +0000
4@@ -1,3 +1,10 @@
5+mediaplayer-app (0.20.5+14.10.20140502-0ubuntu4) UNRELEASED; urgency=medium
6+
7+ * Port autopilot tests to Python 3.
8+ * Bump Standards-Version to 3.9.5.
9+
10+ -- Barry Warsaw <barry@ubuntu.com> Mon, 09 Jun 2014 15:47:08 -0400
11+
12 mediaplayer-app (0.20.5+14.10.20140502-0ubuntu3) utopic; urgency=medium
13
14 * Renaming dep package qtdeclarative5-qtmultimedia-plugin to
15
16=== modified file 'debian/control'
17--- debian/control 2014-05-09 16:11:44 +0000
18+++ debian/control 2014-06-09 19:48:39 +0000
19@@ -8,11 +8,11 @@
20 libgl1-mesa-dev | libgl-dev,
21 libgles2-mesa-dev,
22 pkg-config,
23- python,
24+ python3,
25 qtbase5-dev,
26 qtdeclarative5-dev,
27 qtmultimedia5-dev,
28-Standards-Version: 3.9.4
29+Standards-Version: 3.9.5
30 # If you don't have commit rights to lp:mediaplayer-app but need to upload
31 # packaging changes, just go ahead. The developers will notice and sync
32 # up the code again.
33@@ -43,7 +43,7 @@
34 libqt5test5,
35 libqt5widgets5,
36 mediaplayer-app (>= ${source:Version}),
37- python-autopilot,
38+ python3-autopilot,
39 Conflicts: media-player-autopilot
40 Replaces: media-player-autopilot
41 Provides: media-player-autopilot
42
43=== modified file 'tests/autopilot/CMakeLists.txt'
44--- tests/autopilot/CMakeLists.txt 2013-05-23 20:00:37 +0000
45+++ tests/autopilot/CMakeLists.txt 2014-06-09 19:48:39 +0000
46@@ -1,6 +1,6 @@
47 set(AUTOPILOT_DIR mediaplayer_app)
48
49-execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
50+execute_process(COMMAND python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
51 OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
52
53 install(DIRECTORY ${AUTOPILOT_DIR}
54
55=== modified file 'tests/autopilot/mediaplayer_app/emulators/main_window.py'
56--- tests/autopilot/mediaplayer_app/emulators/main_window.py 2013-10-21 11:47:18 +0000
57+++ tests/autopilot/mediaplayer_app/emulators/main_window.py 2014-06-09 19:48:39 +0000
58@@ -6,7 +6,7 @@
59 # by the Free Software Foundation.
60
61
62-class MainWindow(object):
63+class MainWindow:
64 """An emulator class that makes it easy to interact with the camera-app."""
65
66 def __init__(self, app):
67@@ -17,10 +17,10 @@
68 return self.app.select_single("QQuickView")
69
70 def get_controls(self):
71- return self.app.select_single("Controls", objectName="controls")
72+ return self.app.select_single("Controls", objectName="controls")
73
74 def get_video_area(self):
75- return self.app.select_single("VideoPlayer", objectName="player")
76+ return self.app.select_single("VideoPlayer", objectName="player")
77
78 def get_toolbar(self):
79 return self.app.select_single("GenericToolbar", objectName="toolbar")
80
81=== modified file 'tests/autopilot/mediaplayer_app/tests/__init__.py'
82--- tests/autopilot/mediaplayer_app/tests/__init__.py 2013-09-04 16:25:10 +0000
83+++ tests/autopilot/mediaplayer_app/tests/__init__.py 2014-06-09 19:48:39 +0000
84@@ -7,7 +7,6 @@
85
86 """mediaplayer-app autopilot tests."""
87
88-import os.path
89 import os
90
91 from autopilot.input import Mouse, Touch, Pointer
92
93=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player.py'
94--- tests/autopilot/mediaplayer_app/tests/test_player.py 2013-10-21 11:47:18 +0000
95+++ tests/autopilot/mediaplayer_app/tests/test_player.py 2014-06-09 19:48:39 +0000
96@@ -7,8 +7,6 @@
97
98 """Tests for the Mediaplayer App"""
99
100-from __future__ import absolute_import
101-
102 from autopilot.matchers import Eventually
103 from testtools.matchers import Equals
104
105@@ -26,15 +24,11 @@
106 self.assertThat(
107 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
108
109- def tearDown(self):
110- super(TestPlayer, self).tearDown()
111-
112 def test_no_video_dialog_visible(self):
113 """ Makes sure 'No Video' dialog appears if the meidaplayer is opened
114 without a video file argument.
115
116 """
117
118- dialog = self.main_window.get_no_video_dialog()
119+ dialog = self.main_window.get_no_video_dialog()
120 self.assertThat(dialog.visible, Eventually(Equals(True)))
121-
122
123=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player_with_video.py'
124--- tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2014-04-17 21:30:48 +0000
125+++ tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2014-06-09 19:48:39 +0000
126@@ -7,8 +7,6 @@
127
128 """Tests for the Mediaplayer App"""
129
130-from __future__ import absolute_import
131-
132 from autopilot.matchers import Eventually
133 from autopilot.platform import model
134 from testtools import skipIf
135@@ -26,8 +24,9 @@
136 In the testfarm, the application may take some time to show up."""
137 def setUp(self):
138 super(TestPlayerWithVideo, self).setUp()
139- print model()
140- if model() == 'Nexus 4' or model() == 'Galaxy Nexus' or model() == "Nexus 7 (2013) Wi-Fi" or model() == "Nexus 10":
141+ print(model())
142+ if model() in (
143+ 'Nexus 4', 'Galaxy Nexus', "Nexus 7 (2013) Wi-Fi", "Nexus 10"):
144 self.launch_app("h264.avi")
145 else:
146 self.launch_app("small.ogg")
147@@ -37,9 +36,6 @@
148 player = self.main_window.get_player()
149 self.assertThat(player.playing, Eventually(Equals(True)))
150
151- def tearDown(self):
152- super(TestPlayerWithVideo, self).tearDown()
153-
154 def show_controls(self):
155 video_area = self.main_window.get_video_area()
156 self.pointing_device.click_object(video_area)
157@@ -56,22 +52,20 @@
158 playback_button = self.main_window.get_playback_button()
159 player = self.main_window.get_player()
160
161- """ Default state after load the video is playing and with pause
162- icon.
163- """
164+ # Default state after load the video is playing and with pause icon.
165 self.assertProperty(player, playing=True, paused=False)
166 self.assertProperty(playback_button, icon="pause")
167
168 self.pointing_device.click_object(playback_button)
169
170- """ First click must pause the video, change playing state and show
171- play icon. """
172+ # First click must pause the video, change playing state and show play
173+ # icon.
174 self.assertProperty(player, playing=False, paused=True)
175 self.assertProperty(playback_button, icon="play")
176
177 self.pointing_device.click()
178
179- """ Second click should change the state to playing again """
180+ # Second click should change the state to playing again
181 self.assertProperty(player, playing=True, paused=False)
182 self.assertProperty(playback_button, icon="pause")
183
184@@ -83,14 +77,14 @@
185 scene_selector = self.main_window.get_scene_selector()
186 slider = self.main_window.get_slider()
187
188- """ Default state is hide """
189+ # Default state is hide
190 self.assertProperty(scene_selector, visible=False)
191
192- """ Scene selector must apper when clicking int the slider handler """
193+ # Scene selector must apper when clicking int the slider handler
194 self.pointing_device.click_object(slider)
195 self.assertProperty(scene_selector, visible=True)
196
197- """ click again must dismiss the scene selector """
198+ # click again must dismiss the scene selector
199 self.pointing_device.click()
200 self.assertProperty(scene_selector, visible=False)
201
202@@ -104,26 +98,28 @@
203 selector = self.main_window.get_scene_selector()
204 self.assertThat(selector.count, Eventually(GreaterThan(3)))
205
206- """ Show scene selector """
207+ # Show scene selector
208 self.pointing_device.click_object(slider)
209
210- """ Make sure that the scenes are in correct place """
211+ # Make sure that the scenes are in correct place
212 scene_0 = self.main_window.get_scene_0()
213 selectorRect = selector.globalRect
214 self.pointing_device.drag(
215- selectorRect[0], selectorRect[1] + selectorRect[3] / 2,
216- selectorRect[0] + selectorRect[2], selectorRect[1] + selectorRect[3] / 2)
217+ selectorRect[0], selectorRect[1] + selectorRect[3] // 2,
218+ selectorRect[0] + selectorRect[2],
219+ selectorRect[1] + selectorRect[3] // 2)
220 self.assertThat(selector.moving, Eventually(Equals(False)))
221 self.assertThat(scene_0.x, Eventually(Equals(0)))
222
223- """ Click in the second scene """
224+ # Click in the second scene
225 scene_2 = self.main_window.get_scene_2()
226 self.assertThat(scene_2.ready, Eventually(Equals(True)))
227 self.pointing_device.click_object(scene_2)
228 self.assertThat(selector.currentIndex, Eventually(Equals(2)))
229 self.assertProperty(time_line, value=1.107)
230
231- @skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')
232+ @skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
233+ 'Screen width not enough for seekbar')
234 def test_time_display_behavior(self):
235 self.show_controls()
236 self.pause_video()
237@@ -131,24 +127,26 @@
238 time_line = self.main_window.get_slider()
239 time_label = self.main_window.get_time_label()
240
241- """ Seek to the midle of the movie """
242+ # Seek to the midle of the movie
243 self.pointing_device.click_object(time_line)
244
245- """ Time label must show the current video time (diff from zero or empty) """
246+ # Time label must show the current video time (diff from zero or empty)
247 self.assertNotEqual(time_label.text, "00:00:00")
248 self.assertNotEqual(time_label.text, "")
249
250- """ Click in the label to change the state """
251+ # Click in the label to change the state
252 self.pointing_device.click_object(time_label)
253
254- """ After the click the label must show the remaning time (with '-' signal) """
255+ # After the click the label must show the remaning time (with '-'
256+ # signal)
257 self.assertEqual(time_label.text[0:1], "-")
258
259- @skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')
260+ @skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
261+ 'Screen width not enough for seekbar')
262 def test_show_controls_at_end(self):
263 controls = self.main_window.get_controls()
264- """ The controls are invisible by default """
265+ # The controls are invisible by default
266 self.assertThat(controls.visible, Eventually(Equals(False)))
267
268- """ wait for video ends and control appears """
269+ # wait for video ends and control appears
270 self.assertThat(controls.visible, Eventually(Equals(True), timeout=35))

Subscribers

People subscribed via source and target branches