Merge lp:~om26er/mediaplayer-app/fix_most_pep8_complaints into lp:mediaplayer-app

Proposed by Omer Akram
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 92
Merged at revision: 96
Proposed branch: lp:~om26er/mediaplayer-app/fix_most_pep8_complaints
Merge into: lp:mediaplayer-app
Diff against target: 226 lines (+43/-38)
4 files modified
tests/autopilot/mediaplayer_app/emulators/main_window.py (+1/-0)
tests/autopilot/mediaplayer_app/tests/__init__.py (+21/-17)
tests/autopilot/mediaplayer_app/tests/test_player.py (+3/-2)
tests/autopilot/mediaplayer_app/tests/test_player_with_video.py (+18/-19)
To merge this branch: bzr merge lp:~om26er/mediaplayer-app/fix_most_pep8_complaints
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+165855@code.launchpad.net

Commit message

fix quite a few pep8 complaints for the autopilot tests

Description of the change

fixes quite a few pep8 complaints for the autopilot tests

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

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/mediaplayer_app/emulators/main_window.py'
2--- tests/autopilot/mediaplayer_app/emulators/main_window.py 2013-03-05 20:22:15 +0000
3+++ tests/autopilot/mediaplayer_app/emulators/main_window.py 2013-06-07 14:27:07 +0000
4@@ -5,6 +5,7 @@
5 # under the terms of the GNU General Public License version 3, as published
6 # by the Free Software Foundation.
7
8+
9 class MainWindow(object):
10 """An emulator class that makes it easy to interact with the camera-app."""
11
12
13=== modified file 'tests/autopilot/mediaplayer_app/tests/__init__.py'
14--- tests/autopilot/mediaplayer_app/tests/__init__.py 2013-05-23 20:00:37 +0000
15+++ tests/autopilot/mediaplayer_app/tests/__init__.py 2013-06-07 14:27:07 +0000
16@@ -17,25 +17,30 @@
17
18 from mediaplayer_app.emulators.main_window import MainWindow
19
20+
21 class MediaplayerAppTestCase(AutopilotTestCase):
22
23- """A common test case class that provides several useful methods for mediaplayer-app tests."""
24+ """A common test case class that provides several useful methods for
25+ mediaplayer-app tests.
26+
27+ """
28
29 if model() == 'Desktop':
30 scenarios = [
31- ('with mouse', dict(input_device_class=Mouse))]
32+ ('with mouse', dict(input_device_class=Mouse))]
33 else:
34 scenarios = [
35- ('with touch', dict(input_device_class=Touch))]
36+ ('with touch', dict(input_device_class=Touch))]
37
38 def setUp(self):
39 self.pointing_device = Pointer(self.input_device_class.create())
40 super(MediaplayerAppTestCase, self).setUp()
41
42 def launch_app(self, movie_file=None):
43- if movie_file == None:
44+ if movie_file is None:
45 movie_file = ""
46- # Lets assume we are installed system wide if this file is somewhere in /usr
47+ # Lets assume we are installed system wide if this file is somewhere
48+ # in /usr
49 if os.path.realpath(__file__).startswith("/usr/"):
50 self.launch_test_installed(movie_file)
51 else:
52@@ -46,27 +51,26 @@
53 mp_data_dir = os.environ['MEDIAPLAYER_DATA_DIR']
54 if mp_app:
55 self.app = self.launch_test_application(
56- mp_app,
57- "-w",
58- "file://%s/%s"%(mp_data_dir, movie_file))
59+ mp_app,
60+ "-w",
61+ "file://%s/%s" % (mp_data_dir, movie_file))
62 else:
63 self.app = None
64
65 def launch_test_installed(self, movie_file):
66 if model() == 'Desktop':
67 self.app = self.launch_test_application(
68- "mediaplayer-app",
69- "-w",
70- "/usr/share/mediaplayer-app/videos/" + movie_file)
71+ "mediaplayer-app",
72+ "-w",
73+ "/usr/share/mediaplayer-app/videos/" + movie_file)
74 else:
75 self.app = self.launch_test_application(
76- "mediaplayer-app",
77- "file:///usr/share/mediaplayer-app/videos/" + movie_file,
78- "--fullscreen",
79- "--desktop_file_hint=/usr/share/applications/mediaplayer-app.desktop",
80- app_type='qt')
81+ "mediaplayer-app",
82+ "file:///usr/share/mediaplayer-app/videos/" + movie_file,
83+ "--fullscreen",
84+ "--desktop_file_hint=/usr/share/applications/mediaplayer-app.desktop",
85+ app_type='qt')
86
87 @property
88 def main_window(self):
89 return MainWindow(self.app)
90-
91
92=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player.py'
93--- tests/autopilot/mediaplayer_app/tests/test_player.py 2013-05-01 16:50:43 +0000
94+++ tests/autopilot/mediaplayer_app/tests/test_player.py 2013-06-07 14:27:07 +0000
95@@ -19,6 +19,7 @@
96 import os
97 from os import path
98
99+
100 class TestPlayer(MediaplayerAppTestCase):
101 """Tests the main media player features"""
102
103@@ -27,7 +28,8 @@
104 def setUp(self):
105 super(TestPlayer, self).setUp()
106 self.launch_app()
107- self.assertThat(self.main_window.get_qml_view().visible, Eventually(Equals(True)))
108+ self.assertThat(
109+ self.main_window.get_qml_view().visible, Eventually(Equals(True)))
110
111 def tearDown(self):
112 super(TestPlayer, self).tearDown()
113@@ -48,4 +50,3 @@
114 """ Toolbar must disappear when clicked in the video area again """
115 self.pointing_device.click()
116 self.assertProperty(controls, visible=True)
117-
118
119=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player_with_video.py'
120--- tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-05-28 12:35:14 +0000
121+++ tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-06-07 14:27:07 +0000
122@@ -18,6 +18,7 @@
123
124 from mediaplayer_app.tests import MediaplayerAppTestCase
125
126+
127 class TestPlayerWithVideo(MediaplayerAppTestCase):
128 """Tests the main media player features while playing a video """
129
130@@ -26,7 +27,8 @@
131 def setUp(self):
132 super(TestPlayerWithVideo, self).setUp()
133 self.launch_app("small.mp4")
134- self.assertThat(self.main_window.get_qml_view().visible, Eventually(Equals(True)))
135+ self.assertThat(
136+ self.main_window.get_qml_view().visible, Eventually(Equals(True)))
137
138 def tearDown(self):
139 super(TestPlayerWithVideo, self).tearDown()
140@@ -49,14 +51,17 @@
141 playback_buttom = self.main_window.get_object("IconButton", "Controls.PlayBackButton")
142 player = self.main_window.get_object("VideoPlayer", "player")
143
144- """ Default state after load the video is playing and with pause icon """
145+ """ Default state after load the video is playing and with pause
146+ icon.
147+ """
148 self.assertProperty(player, playing=True, paused=False)
149 self.assertProperty(playback_buttom, icon="pause")
150
151 self.pointing_device.move_to_object(playback_buttom)
152 self.pointing_device.click()
153
154- """ First click must pause the video, change playing state and show play icon """
155+ """ First click must pause the video, change playing state and show
156+ play icon. """
157 self.assertProperty(player, playing=False, paused=True)
158 self.assertProperty(playback_buttom, icon="play")
159
160@@ -94,7 +99,7 @@
161 slider = self.main_window.get_object("Slider", "TimeLine.Slider")
162 time_line = self.main_window.get_object("TimeLine", "TimeLine")
163 selector = self.main_window.get_object("SceneSelector", "Controls.SceneSelector")
164- self.assertThat(selector.count, Eventually(GreaterThan(3)))
165+ self.assertThat(selector.count, Eventually(GreaterThan(3)))
166
167 """ Show scene selector """
168 self.pointing_device.move_to_object(slider)
169@@ -103,8 +108,9 @@
170 """ Make sure that the scenes are in correct place """
171 scene_0 = self.main_window.get_object("SceneFrame", "SceneSelector.Scene0")
172 selectorRect = selector.globalRect
173- self.pointing_device.drag(selectorRect[0], selectorRect[1] + selectorRect[3] / 2,
174- selectorRect[0] + selectorRect[2], selectorRect[1] + selectorRect[3] / 2)
175+ self.pointing_device.drag(
176+ selectorRect[0], selectorRect[1] + selectorRect[3] / 2,
177+ selectorRect[0] + selectorRect[2], selectorRect[1] + selectorRect[3] / 2)
178 self.assertThat(selector.moving, Eventually(Equals(False)))
179 self.assertThat(scene_0.x, Eventually(Equals(0)))
180
181@@ -129,8 +135,8 @@
182 self.pointing_device.click()
183
184 """ Time label must show the current video time
185- - Depends on the resolution the current time can be different due the slider size,
186- because of that we avoid compare the secs
187+ - Depends on the resolution the current time can be different due
188+ the slider size, because of that we avoid compare the secs
189 """
190 self.assertEqual(time_label.text[0:7], "00:00:0")
191
192@@ -139,8 +145,8 @@
193 self.pointing_device.click()
194
195 """ After the click the label must show the remaning time
196- - Depends on the resolution the current time can be different due the slider size,
197- because of that we avoid compare the secs
198+ - Depends on the resolution the current time can be different due
199+ the slider size, because of that we avoid compare the secs
200 """
201 self.assertEqual(time_label.text[0:9], "- 00:00:0")
202
203@@ -149,10 +155,10 @@
204 self.show_controls()
205 time_line = self.main_window.get_object("Slider", "TimeLine.Slider")
206
207- """ Seek to the midle of the video """
208+ """ Seek to the midle of the video """
209 self.pointing_device.move_to_object(time_line)
210 self.pointing_device.click()
211-
212+
213 """ hide controls """
214 video_area = self.main_window.get_object("VideoPlayer", "player")
215 self.pointing_device.move_to_object(video_area)
216@@ -162,10 +168,3 @@
217 controls = self.main_window.get_object("Controls", "controls")
218 self.assertProperty(controls, visible=False)
219 self.assertThat(controls.visible, Eventually(Equals(True)))
220-
221-
222-
223-
224-
225-
226-

Subscribers

People subscribed via source and target branches