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
=== modified file 'tests/autopilot/mediaplayer_app/emulators/main_window.py'
--- tests/autopilot/mediaplayer_app/emulators/main_window.py 2013-03-05 20:22:15 +0000
+++ tests/autopilot/mediaplayer_app/emulators/main_window.py 2013-06-07 14:27:07 +0000
@@ -5,6 +5,7 @@
5# under the terms of the GNU General Public License version 3, as published5# under the terms of the GNU General Public License version 3, as published
6# by the Free Software Foundation.6# by the Free Software Foundation.
77
8
8class MainWindow(object):9class MainWindow(object):
9 """An emulator class that makes it easy to interact with the camera-app."""10 """An emulator class that makes it easy to interact with the camera-app."""
1011
1112
=== modified file 'tests/autopilot/mediaplayer_app/tests/__init__.py'
--- tests/autopilot/mediaplayer_app/tests/__init__.py 2013-05-23 20:00:37 +0000
+++ tests/autopilot/mediaplayer_app/tests/__init__.py 2013-06-07 14:27:07 +0000
@@ -17,25 +17,30 @@
1717
18from mediaplayer_app.emulators.main_window import MainWindow18from mediaplayer_app.emulators.main_window import MainWindow
1919
20
20class MediaplayerAppTestCase(AutopilotTestCase):21class MediaplayerAppTestCase(AutopilotTestCase):
2122
22 """A common test case class that provides several useful methods for mediaplayer-app tests."""23 """A common test case class that provides several useful methods for
24 mediaplayer-app tests.
25
26 """
2327
24 if model() == 'Desktop':28 if model() == 'Desktop':
25 scenarios = [29 scenarios = [
26 ('with mouse', dict(input_device_class=Mouse))]30 ('with mouse', dict(input_device_class=Mouse))]
27 else:31 else:
28 scenarios = [32 scenarios = [
29 ('with touch', dict(input_device_class=Touch))]33 ('with touch', dict(input_device_class=Touch))]
3034
31 def setUp(self):35 def setUp(self):
32 self.pointing_device = Pointer(self.input_device_class.create())36 self.pointing_device = Pointer(self.input_device_class.create())
33 super(MediaplayerAppTestCase, self).setUp()37 super(MediaplayerAppTestCase, self).setUp()
3438
35 def launch_app(self, movie_file=None):39 def launch_app(self, movie_file=None):
36 if movie_file == None:40 if movie_file is None:
37 movie_file = ""41 movie_file = ""
38 # Lets assume we are installed system wide if this file is somewhere in /usr42 # Lets assume we are installed system wide if this file is somewhere
43 # in /usr
39 if os.path.realpath(__file__).startswith("/usr/"):44 if os.path.realpath(__file__).startswith("/usr/"):
40 self.launch_test_installed(movie_file)45 self.launch_test_installed(movie_file)
41 else:46 else:
@@ -46,27 +51,26 @@
46 mp_data_dir = os.environ['MEDIAPLAYER_DATA_DIR']51 mp_data_dir = os.environ['MEDIAPLAYER_DATA_DIR']
47 if mp_app:52 if mp_app:
48 self.app = self.launch_test_application(53 self.app = self.launch_test_application(
49 mp_app,54 mp_app,
50 "-w",55 "-w",
51 "file://%s/%s"%(mp_data_dir, movie_file))56 "file://%s/%s" % (mp_data_dir, movie_file))
52 else:57 else:
53 self.app = None58 self.app = None
5459
55 def launch_test_installed(self, movie_file):60 def launch_test_installed(self, movie_file):
56 if model() == 'Desktop':61 if model() == 'Desktop':
57 self.app = self.launch_test_application(62 self.app = self.launch_test_application(
58 "mediaplayer-app",63 "mediaplayer-app",
59 "-w",64 "-w",
60 "/usr/share/mediaplayer-app/videos/" + movie_file)65 "/usr/share/mediaplayer-app/videos/" + movie_file)
61 else:66 else:
62 self.app = self.launch_test_application(67 self.app = self.launch_test_application(
63 "mediaplayer-app",68 "mediaplayer-app",
64 "file:///usr/share/mediaplayer-app/videos/" + movie_file,69 "file:///usr/share/mediaplayer-app/videos/" + movie_file,
65 "--fullscreen",70 "--fullscreen",
66 "--desktop_file_hint=/usr/share/applications/mediaplayer-app.desktop",71 "--desktop_file_hint=/usr/share/applications/mediaplayer-app.desktop",
67 app_type='qt')72 app_type='qt')
6873
69 @property74 @property
70 def main_window(self):75 def main_window(self):
71 return MainWindow(self.app)76 return MainWindow(self.app)
72
7377
=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player.py'
--- tests/autopilot/mediaplayer_app/tests/test_player.py 2013-05-01 16:50:43 +0000
+++ tests/autopilot/mediaplayer_app/tests/test_player.py 2013-06-07 14:27:07 +0000
@@ -19,6 +19,7 @@
19import os19import os
20from os import path20from os import path
2121
22
22class TestPlayer(MediaplayerAppTestCase):23class TestPlayer(MediaplayerAppTestCase):
23 """Tests the main media player features"""24 """Tests the main media player features"""
2425
@@ -27,7 +28,8 @@
27 def setUp(self):28 def setUp(self):
28 super(TestPlayer, self).setUp()29 super(TestPlayer, self).setUp()
29 self.launch_app()30 self.launch_app()
30 self.assertThat(self.main_window.get_qml_view().visible, Eventually(Equals(True)))31 self.assertThat(
32 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
3133
32 def tearDown(self):34 def tearDown(self):
33 super(TestPlayer, self).tearDown()35 super(TestPlayer, self).tearDown()
@@ -48,4 +50,3 @@
48 """ Toolbar must disappear when clicked in the video area again """50 """ Toolbar must disappear when clicked in the video area again """
49 self.pointing_device.click()51 self.pointing_device.click()
50 self.assertProperty(controls, visible=True)52 self.assertProperty(controls, visible=True)
51
5253
=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player_with_video.py'
--- tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-05-28 12:35:14 +0000
+++ tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-06-07 14:27:07 +0000
@@ -18,6 +18,7 @@
1818
19from mediaplayer_app.tests import MediaplayerAppTestCase19from mediaplayer_app.tests import MediaplayerAppTestCase
2020
21
21class TestPlayerWithVideo(MediaplayerAppTestCase):22class TestPlayerWithVideo(MediaplayerAppTestCase):
22 """Tests the main media player features while playing a video """23 """Tests the main media player features while playing a video """
2324
@@ -26,7 +27,8 @@
26 def setUp(self):27 def setUp(self):
27 super(TestPlayerWithVideo, self).setUp()28 super(TestPlayerWithVideo, self).setUp()
28 self.launch_app("small.mp4")29 self.launch_app("small.mp4")
29 self.assertThat(self.main_window.get_qml_view().visible, Eventually(Equals(True)))30 self.assertThat(
31 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
3032
31 def tearDown(self):33 def tearDown(self):
32 super(TestPlayerWithVideo, self).tearDown()34 super(TestPlayerWithVideo, self).tearDown()
@@ -49,14 +51,17 @@
49 playback_buttom = self.main_window.get_object("IconButton", "Controls.PlayBackButton")51 playback_buttom = self.main_window.get_object("IconButton", "Controls.PlayBackButton")
50 player = self.main_window.get_object("VideoPlayer", "player")52 player = self.main_window.get_object("VideoPlayer", "player")
5153
52 """ Default state after load the video is playing and with pause icon """54 """ Default state after load the video is playing and with pause
55 icon.
56 """
53 self.assertProperty(player, playing=True, paused=False)57 self.assertProperty(player, playing=True, paused=False)
54 self.assertProperty(playback_buttom, icon="pause")58 self.assertProperty(playback_buttom, icon="pause")
5559
56 self.pointing_device.move_to_object(playback_buttom)60 self.pointing_device.move_to_object(playback_buttom)
57 self.pointing_device.click()61 self.pointing_device.click()
5862
59 """ First click must pause the video, change playing state and show play icon """63 """ First click must pause the video, change playing state and show
64 play icon. """
60 self.assertProperty(player, playing=False, paused=True)65 self.assertProperty(player, playing=False, paused=True)
61 self.assertProperty(playback_buttom, icon="play")66 self.assertProperty(playback_buttom, icon="play")
6267
@@ -94,7 +99,7 @@
94 slider = self.main_window.get_object("Slider", "TimeLine.Slider")99 slider = self.main_window.get_object("Slider", "TimeLine.Slider")
95 time_line = self.main_window.get_object("TimeLine", "TimeLine")100 time_line = self.main_window.get_object("TimeLine", "TimeLine")
96 selector = self.main_window.get_object("SceneSelector", "Controls.SceneSelector")101 selector = self.main_window.get_object("SceneSelector", "Controls.SceneSelector")
97 self.assertThat(selector.count, Eventually(GreaterThan(3))) 102 self.assertThat(selector.count, Eventually(GreaterThan(3)))
98103
99 """ Show scene selector """104 """ Show scene selector """
100 self.pointing_device.move_to_object(slider)105 self.pointing_device.move_to_object(slider)
@@ -103,8 +108,9 @@
103 """ Make sure that the scenes are in correct place """108 """ Make sure that the scenes are in correct place """
104 scene_0 = self.main_window.get_object("SceneFrame", "SceneSelector.Scene0")109 scene_0 = self.main_window.get_object("SceneFrame", "SceneSelector.Scene0")
105 selectorRect = selector.globalRect110 selectorRect = selector.globalRect
106 self.pointing_device.drag(selectorRect[0], selectorRect[1] + selectorRect[3] / 2,111 self.pointing_device.drag(
107 selectorRect[0] + selectorRect[2], selectorRect[1] + selectorRect[3] / 2)112 selectorRect[0], selectorRect[1] + selectorRect[3] / 2,
113 selectorRect[0] + selectorRect[2], selectorRect[1] + selectorRect[3] / 2)
108 self.assertThat(selector.moving, Eventually(Equals(False)))114 self.assertThat(selector.moving, Eventually(Equals(False)))
109 self.assertThat(scene_0.x, Eventually(Equals(0)))115 self.assertThat(scene_0.x, Eventually(Equals(0)))
110116
@@ -129,8 +135,8 @@
129 self.pointing_device.click()135 self.pointing_device.click()
130136
131 """ Time label must show the current video time137 """ Time label must show the current video time
132 - Depends on the resolution the current time can be different due the slider size,138 - Depends on the resolution the current time can be different due
133 because of that we avoid compare the secs139 the slider size, because of that we avoid compare the secs
134 """140 """
135 self.assertEqual(time_label.text[0:7], "00:00:0")141 self.assertEqual(time_label.text[0:7], "00:00:0")
136142
@@ -139,8 +145,8 @@
139 self.pointing_device.click()145 self.pointing_device.click()
140146
141 """ After the click the label must show the remaning time147 """ After the click the label must show the remaning time
142 - Depends on the resolution the current time can be different due the slider size,148 - Depends on the resolution the current time can be different due
143 because of that we avoid compare the secs149 the slider size, because of that we avoid compare the secs
144 """150 """
145 self.assertEqual(time_label.text[0:9], "- 00:00:0")151 self.assertEqual(time_label.text[0:9], "- 00:00:0")
146152
@@ -149,10 +155,10 @@
149 self.show_controls()155 self.show_controls()
150 time_line = self.main_window.get_object("Slider", "TimeLine.Slider")156 time_line = self.main_window.get_object("Slider", "TimeLine.Slider")
151157
152 """ Seek to the midle of the video """ 158 """ Seek to the midle of the video """
153 self.pointing_device.move_to_object(time_line)159 self.pointing_device.move_to_object(time_line)
154 self.pointing_device.click()160 self.pointing_device.click()
155 161
156 """ hide controls """162 """ hide controls """
157 video_area = self.main_window.get_object("VideoPlayer", "player")163 video_area = self.main_window.get_object("VideoPlayer", "player")
158 self.pointing_device.move_to_object(video_area)164 self.pointing_device.move_to_object(video_area)
@@ -162,10 +168,3 @@
162 controls = self.main_window.get_object("Controls", "controls")168 controls = self.main_window.get_object("Controls", "controls")
163 self.assertProperty(controls, visible=False)169 self.assertProperty(controls, visible=False)
164 self.assertThat(controls.visible, Eventually(Equals(True)))170 self.assertThat(controls.visible, Eventually(Equals(True)))
165
166
167
168
169
170
171

Subscribers

People subscribed via source and target branches