Merge lp:~pedro/mago/banshee into lp:~mago-contributors/mago/mago-1.0
- banshee
- Merge into mago-1.0
Proposed by
Pedro Villavicencio
Status: | Merged |
---|---|
Merged at revision: | 150 |
Proposed branch: | lp:~pedro/mago/banshee |
Merge into: | lp:~mago-contributors/mago/mago-1.0 |
Diff against target: |
535 lines (+489/-0) 9 files modified
banshee/README (+24/-0) banshee/banshee_tests.py (+50/-0) banshee/banshee_tests.xml (+68/-0) banshee/data/extendedm3u.m3u (+11/-0) banshee/data/extendedpls.pls (+15/-0) banshee/data/simplem3u.m3u (+5/-0) banshee/data/simplepls.pls (+8/-0) mago/application/banshee.py (+278/-0) mago/test_suite/banshee.py (+30/-0) |
To merge this branch: | bzr merge lp:~pedro/mago/banshee |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nagappan Alagappan | Approve | ||
Review via email:
|
Commit message
Description of the change
Banshee tests, currently it supports:
* Enable/Disable Plugins: Plugin disabled due to a crash: bug 681362
* Import playlists:
- Import extended m3u
- Import extended pls
- Import simple m3u
- Import simple pls
* Add Podcast.
* Check the Miro podcast directory.
* Smart Playlist creation with utf8 characters.
* Play a file.
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jean-Baptiste Lallement (jibel) wrote : | # |
Merged to trunk with the modifications suggested by Nagappan.
Nice work. Thanks all.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'banshee' |
2 | === added file 'banshee/README' |
3 | --- banshee/README 1970-01-01 00:00:00 +0000 |
4 | +++ banshee/README 2010-11-26 11:36:12 +0000 |
5 | @@ -0,0 +1,24 @@ |
6 | +BANSHEE TESTS |
7 | +============= |
8 | + |
9 | +Safety |
10 | +------ |
11 | +The recommendation is to run these tests on a separate user configuration since it deletes the banshee configuration and the Podcasts. |
12 | + |
13 | +Configuration |
14 | +------------- |
15 | +A few playlists need to be available at the data/ directory, which are available with these tests. |
16 | + |
17 | +Available Tests |
18 | +--------------- |
19 | + |
20 | +* Enable/Disable Plugins: Plugin disabled due to a crash , |
21 | +* Import playlists: |
22 | + - Import extended m3u |
23 | + - Import extended pls |
24 | + - Import simple m3u |
25 | + - Import simple pls |
26 | +* Add Podcast. |
27 | +* Check the Miro podcast directory. |
28 | +* Smart Playlist creation with utf8 characters. |
29 | +* Play a file. |
30 | |
31 | === added file 'banshee/banshee_tests.py' |
32 | --- banshee/banshee_tests.py 1970-01-01 00:00:00 +0000 |
33 | +++ banshee/banshee_tests.py 2010-11-26 11:36:12 +0000 |
34 | @@ -0,0 +1,50 @@ |
35 | +# -*- coding: utf-8 -*- |
36 | +import os |
37 | +import shutil |
38 | +from time import time, gmtime, strftime |
39 | + |
40 | +from mago.test_suite.banshee import Banshee_TestSuite |
41 | + |
42 | +class Banshee_Tests(Banshee_TestSuite): |
43 | + |
44 | + def enable_disable_plugins(self): |
45 | + self.application.banshee_enable_disable_plugins(True) |
46 | + self.application.banshee_enable_disable_plugins(False) |
47 | + self.application.banshee_enable_disable_plugins(True) |
48 | + |
49 | + def add_podcast(self, podcast_url): |
50 | + self.application.banshee_add_podcast(podcast_url) |
51 | + #remove the podcast folder. |
52 | + podcasts_folder = os.getenv('HOME') + '/Podcasts/' |
53 | + if os.path.exists(podcasts_folder): |
54 | + shutil.rmtree(podcasts_folder) |
55 | + |
56 | + def import_extended_m3u(self, extendedm3u): |
57 | + path = os.path.join(self.get_test_dir(), extendedm3u) |
58 | + self.application.banshee_import_playlist(path) |
59 | + |
60 | + def import_extended_pls(self, extendedpls): |
61 | + path = os.path.join(self.get_test_dir(), extendedpls) |
62 | + self.application.banshee_import_playlist(path) |
63 | + |
64 | + def import_simple_m3u(self, simplem3u): |
65 | + path = os.path.join(self.get_test_dir(), simplem3u) |
66 | + self.application.banshee_import_playlist(path) |
67 | + |
68 | + def import_simple_pls(self, simplepls): |
69 | + path = os.path.join(self.get_test_dir(), simplepls) |
70 | + self.application.banshee_import_playlist(path) |
71 | + |
72 | + def test_miro_guide(self): |
73 | + self.application.banshee_miro_guide() |
74 | + |
75 | + def play_file(self, file_path, tmp_path): |
76 | + self.application.create_wav_file(440, file_path) |
77 | + self.application.banshee_play_file(file_path, tmp_path) |
78 | + |
79 | + def create_smart_playlist(self, playlist_name, artist): |
80 | + self.application.banshee_create_smart_playlist(playlist_name, artist) |
81 | + |
82 | +if __name__ == "__main__": |
83 | + banshee_test = Banshee_Tests() |
84 | + banshee_test.run() |
85 | |
86 | === added file 'banshee/banshee_tests.xml' |
87 | --- banshee/banshee_tests.xml 1970-01-01 00:00:00 +0000 |
88 | +++ banshee/banshee_tests.xml 2010-11-26 11:36:12 +0000 |
89 | @@ -0,0 +1,68 @@ |
90 | +<?xml version="1.0"?> |
91 | +<suite name="Banshee"> |
92 | + <class>banshee_tests.Banshee_Tests</class> |
93 | + <description> |
94 | + Tests that verifies Banshee functionalities. |
95 | + </description> |
96 | +<!-- this test case makes banshee crash so disabling it for now, |
97 | + filed bug about it: https://bugs.launchpad.net/ubuntu/+source/banshee/+bug/681362 |
98 | + <case name="Enable/Disable Plugins"> |
99 | + <method>enable_disable_plugins</method> |
100 | + <description>Enables and disable all the plugins available in banshee</description> |
101 | + </case>--> |
102 | + <case name="Import extended m3u"> |
103 | + <method>import_extended_m3u</method> |
104 | + <description>Import an extended m3u playlist</description> |
105 | + <args> |
106 | + <extendedm3u>data/extendedm3u.m3u</extendedm3u> |
107 | + </args> |
108 | + </case> |
109 | + <case name="Import extended pls"> |
110 | + <method>import_extended_pls</method> |
111 | + <description>Import an extended pls playlist</description> |
112 | + <args> |
113 | + <extendedpls>data/extendedpls.pls</extendedpls> |
114 | + </args> |
115 | + </case> |
116 | + <case name="Import simple m3u"> |
117 | + <method>import_simple_m3u</method> |
118 | + <description>Import a simple m3u playlist</description> |
119 | + <args> |
120 | + <simplem3u>data/simplem3u.m3u</simplem3u> |
121 | + </args> |
122 | + </case> |
123 | + <case name="Import simple pls"> |
124 | + <method>import_simple_pls</method> |
125 | + <description>Import a simple pls playlist</description> |
126 | + <args> |
127 | + <simplepls>data/simplepls.pls</simplepls> |
128 | + </args> |
129 | + </case> |
130 | + <case name="Add Podcast"> |
131 | + <method>add_podcast</method> |
132 | + <description>Add a Podcast into banshee</description> |
133 | + <args> |
134 | + <podcast_url>http://feeds.feedburner.com/UbuntuUkPodcastOgg-low?format=xml</podcast_url> |
135 | + </args> |
136 | + </case> |
137 | + <case name="Miro"> |
138 | + <method>test_miro_guide</method> |
139 | + <description>Load the Podcast directory - Miro Guide</description> |
140 | + </case> |
141 | + <case name="SmartPlayList"> |
142 | + <method>create_smart_playlist</method> |
143 | + <description>Create an smart Playlist with UTF8 characters</description> |
144 | + <args> |
145 | + <playlist_name>ⵥꜳꜼʨサボ</playlist_name> |
146 | + <artist>⺺⺭⺠⺓⺑⺏⻋</artist> |
147 | + </args> |
148 | + </case> |
149 | + <case name="Play File"> |
150 | + <method>play_file</method> |
151 | + <description>Play a file and verify it works</description> |
152 | + <args> |
153 | + <file_path>/tmp/banshee.wav</file_path> |
154 | + <tmp_path>/tmp/banshee-capture.wav</tmp_path> |
155 | + </args> |
156 | + </case> |
157 | +</suite> |
158 | |
159 | === added directory 'banshee/data' |
160 | === added file 'banshee/data/extendedm3u.m3u' |
161 | --- banshee/data/extendedm3u.m3u 1970-01-01 00:00:00 +0000 |
162 | +++ banshee/data/extendedm3u.m3u 2010-11-26 11:36:12 +0000 |
163 | @@ -0,0 +1,11 @@ |
164 | +#EXTM3U |
165 | +#EXTINF:-1,Remote PLS |
166 | +http://remote/remote.pls |
167 | +#EXTINF:246,Local MP3 |
168 | +local.mp3 |
169 | +#EXTINF:120,Relative Local MP3 |
170 | +relative/local.mp3 |
171 | +#EXTINF:3,Spaced Relative Local MP3 |
172 | +spaced relative/local.mp3 |
173 | +#EXTINF:,Spaced Absolute Local MP3 |
174 | +/spaced absolute/local.mp3 |
175 | |
176 | === added file 'banshee/data/extendedpls.pls' |
177 | --- banshee/data/extendedpls.pls 1970-01-01 00:00:00 +0000 |
178 | +++ banshee/data/extendedpls.pls 2010-11-26 11:36:12 +0000 |
179 | @@ -0,0 +1,15 @@ |
180 | +[playlist] |
181 | +Title1=Remote PLS |
182 | +File1=http://remote/remote.pls |
183 | +Length1=0 |
184 | +File2=local.mp3 |
185 | +Title2=Local MP3 |
186 | +Length2=246 |
187 | +Length3=120 |
188 | +Title3=Relative Local MP3 |
189 | +File3=relative/local.mp3 |
190 | +Title4=Spaced Relative Local MP3 |
191 | +File4=spaced relative/local.mp3 |
192 | +Length4=3 |
193 | +File5=/spaced absolute/local.mp3 |
194 | +Title5=Spaced Absolute Local MP3 |
195 | |
196 | === added file 'banshee/data/simplem3u.m3u' |
197 | --- banshee/data/simplem3u.m3u 1970-01-01 00:00:00 +0000 |
198 | +++ banshee/data/simplem3u.m3u 2010-11-26 11:36:12 +0000 |
199 | @@ -0,0 +1,5 @@ |
200 | +http://remote/remote.pls |
201 | +local.mp3 |
202 | +relative/local.mp3 |
203 | +spaced relative/local.mp3 |
204 | +/spaced absolute/local.mp3 |
205 | |
206 | === added file 'banshee/data/simplepls.pls' |
207 | --- banshee/data/simplepls.pls 1970-01-01 00:00:00 +0000 |
208 | +++ banshee/data/simplepls.pls 2010-11-26 11:36:12 +0000 |
209 | @@ -0,0 +1,8 @@ |
210 | +[playlist] |
211 | +File1=http://remote/remote.pls |
212 | +File2=local.mp3 |
213 | +File3=relative/local.mp3 |
214 | +File4=spaced relative/local.mp3 |
215 | +File5=/spaced absolute/local.mp3 |
216 | +NumberOfEntries=5 |
217 | +Version=2 |
218 | |
219 | === added file 'mago/application/banshee.py' |
220 | --- mago/application/banshee.py 1970-01-01 00:00:00 +0000 |
221 | +++ mago/application/banshee.py 2010-11-26 11:36:12 +0000 |
222 | @@ -0,0 +1,278 @@ |
223 | +PACKAGE = "mago" |
224 | + |
225 | +#-*- coding:utf-8 -*- |
226 | +""" |
227 | +This is the "banshee" module. |
228 | + |
229 | +This module provides a wrapper for LDTP to make writing Banshee tests easier. |
230 | +""" |
231 | +import ooldtp |
232 | +import ldtp |
233 | +import os |
234 | +from .main import Application |
235 | +from ..gconfwrapper import GConf |
236 | +from ..cmd import globals |
237 | +import time |
238 | +import gettext |
239 | +from ..application.totem import Totem |
240 | +import pygst |
241 | +pygst.require("0.10") |
242 | +import gst |
243 | + |
244 | +gettext.install (True) |
245 | +gettext.bindtextdomain (PACKAGE, globals.LOCALE_SHARE) |
246 | +gettext.textdomain (PACKAGE) |
247 | +t = gettext.translation(PACKAGE, globals.LOCALE_SHARE, fallback = True) |
248 | +_ = t.gettext |
249 | + |
250 | + |
251 | +class Banshee(Application): |
252 | + """ |
253 | + banshee manages the Banshee application. |
254 | + """ |
255 | + |
256 | + LAUNCHER = 'banshee-1' |
257 | + LAUNCHER_ARGS = [] |
258 | + WINDOW = 'frmBansheeMediaPlayer' |
259 | + |
260 | + WINDOW_PLAY = 'frmbanshee*' |
261 | + |
262 | + BTN_6 = _('btn6') |
263 | + BTN_7 = _('btn7') |
264 | + BTN_BROWSE = _('btnBrowse') |
265 | + BTN_CLOSE = _('btnClose') |
266 | + BTN_NEXT = _('btnNext') |
267 | + BTN_PLAY = _('btnPlay') |
268 | + BTN_PREVIOUS = _('btnPrevious') |
269 | + BTN_REFRESH = _('btnRefresh') |
270 | + BTN_VOLUME = _('btnVolume') |
271 | + BTN_OPEN = _('btnOpen') |
272 | + BTN_ADDPODCAST = _('btnAddPodcast') |
273 | + BTN_SUBSCRIBE = _('btnSubscribe') |
274 | + BTN_STOP = _('btnStop') |
275 | + BTN_IMPORT = _('btnImport') |
276 | + BTN_HOME = _('btnHome') |
277 | + BTN_SAVE = _('btnSave') |
278 | + CBO_ALBUM = _('cboAlbum') |
279 | + DLG_PREFERENCES = _('dlgPreferences') |
280 | + DLG_OPENLOCATION = _('dlgOpenLocation') |
281 | + DLG_OPENLOCATION_1 = _('dlgOpenLocation1') |
282 | + DLG_SUBSCRIBE = _('dlgSubscribe') |
283 | + DLG_IMPORTPLAYLIST = _('dlgImportPlaylist') |
284 | + DLG_SMARTPLAYLIST = _('dlgNewSmartPlaylist') |
285 | + MNU_ABOUT = _('mnuAbout') |
286 | + MNU_ADDREMOTEDAAPSERVER = _('mnuAddRemoteDAAPServer') |
287 | + MNU_ADVANCEDCOLLECTIONSEARCHING = _('mnuAdvancedCollectionSearching') |
288 | + MNU_BANSHEEHOMEPAGE = _('mnuBansheeHomePage') |
289 | + MNU_BANSHEEUSERGUIDE_WIKI_ = _('mnuBansheeUserGuide(Wiki)') |
290 | + MNU_CLOSE = _('mnuClose') |
291 | + MNU_CONTENTS = _('mnuContents') |
292 | + MNU_DELETEFROMDRIVE = _('mnuDeleteFromDrive') |
293 | + MNU_EDITTRACKINFORMATION = _('mnuEditTrackInformation') |
294 | + MNU_EMPTY = _('mnuEmpty') |
295 | + MNU_EMPTY1 = _('mnuEmpty1') |
296 | + MNU_EMPTY2 = _('mnuEmpty2') |
297 | + MNU_EMPTY3 = _('mnuEmpty3') |
298 | + MNU_EMPTY4 = _('mnuEmpty4') |
299 | + MNU_EMPTY5 = _('mnuEmpty5') |
300 | + MNU_EMPTY6 = _('mnuEmpty6') |
301 | + MNU_EMPTY7 = _('mnuEmpty7') |
302 | + MNU_EMPTY8 = _('mnuEmpty8') |
303 | + MNU_EQUALIZER = _('mnuEqualizer') |
304 | + MNU_EXPORTPLAYLIST = _('mnuExportPlaylist') |
305 | + MNU_FIXMUSICMETADATA = _('mnuFixMusicMetadata') |
306 | + MNU_GETINVOLVED = _('mnuGetInvolved') |
307 | + MNU_IMPORTMEDIA = _('mnuImportMedia') |
308 | + MNU_IMPORTPLAYLIST = _('mnuImportPlaylist') |
309 | + MNU_JUMPTOPLAYINGSONG = _('mnuJumptoPlayingSong') |
310 | + MNU_MANAGEEXTENSIONS = _('mnuManageExtensions') |
311 | + MNU_NEWPLAYLIST = _('mnuNewPlaylist') |
312 | + MNU_NEWSMARTPLAYLIST = _('mnuNewSmartPlaylist') |
313 | + MNU_NEXT = _('mnuNext') |
314 | + MNU_OPENCONTAININGFOLDER = _('mnuOpenContainingFolder') |
315 | + MNU_OPENLOCATION = _('mnuOpenLocation') |
316 | + MNU_PLAY = _('mnuPlay') |
317 | + MNU_PREFERENCES = _('mnuPreferences') |
318 | + MNU_PREVIOUS = _('mnuPrevious') |
319 | + MNU_PROPERTIES = _('mnuProperties') |
320 | + MNU_QUIT = _('mnuQuit') |
321 | + MNU_REFRESH = _('mnuRefresh') |
322 | + MNU_REMOVEFROMLIBRARY = _('mnuRemoveFromLibrary') |
323 | + MNU_REMOVEFROMLIBRARY1 = _('mnuRemoveFromLibrary1') |
324 | + MNU_RENAME = _('mnuRename') |
325 | + MNU_RESCANMUSICLIBRARY = _('mnuRescanMusicLibrary') |
326 | + MNU_RESTARTSONG = _('mnuRestartSong') |
327 | + MNU_SEEKTO = _('mnuSeekTo') |
328 | + MNU_SELECTALL = _('mnuSelectAll') |
329 | + MNU_SELECTNONE = _('mnuSelectNone') |
330 | + MNU_SOURCEPROPERTIES = _('mnuSourceProperties') |
331 | + MNU_SWITCHSOURCE = _('mnuSwitchSource') |
332 | + MNU_UNMAP = _('mnuUnmap') |
333 | + MNU_VERSIONINFORMATION = _('mnuVersionInformation') |
334 | + MNU_VISITUSERPROFILEPAGE = _('mnuVisitUserProfilePage') |
335 | + MNU_WRITECD = _('mnuWriteCD') |
336 | + LBL_MIROGUIDE = _('lblPodcastDirectory-MiroGuide') |
337 | + TXT_0 = _('txt0') |
338 | + TXT_1 = _('txt1') |
339 | + TXT_LOCATION = _('txtLocation') |
340 | + PTABLE = _('ptl0') |
341 | + PTAB_EXTENSIONS = _('ptabExtensions') |
342 | + TBL = _('ttbl0') |
343 | + TBL_LISTVIEW = _('tblListView') |
344 | + TBL_LISTVIEW1 = _('tblListView1') |
345 | + TBL_LISTVIEW2 = _('tblListView2') |
346 | + TBL_LISTVIEW3 = _('tblListView3') |
347 | + |
348 | + header_values = ['Community Extensions', |
349 | + 'Context Pane', |
350 | + 'Core', |
351 | + 'Device Support', |
352 | + 'Online Sources', |
353 | + 'Utilities'] |
354 | + |
355 | + def banshee_enable_disable_plugins(self, enable): |
356 | + banshee = ooldtp.context(self.WINDOW) |
357 | + banshee.getchild(self.MNU_PREFERENCES).selectmenuitem() |
358 | + ldtp.waittillguiexist(self.DLG_PREFERENCES) |
359 | + bansheePreferences = ooldtp.context(self.DLG_PREFERENCES) |
360 | + bansheePreferences.getchild(self.PTABLE).selecttab(self.PTAB_EXTENSIONS) |
361 | + row_count = bansheePreferences.getrowcount(self.TBL) |
362 | + row = 0 |
363 | + while row < row_count: |
364 | + first_column = bansheePreferences.getcellvalue(self.TBL, row, 0) |
365 | + if first_column not in self.header_values: |
366 | + if enable: |
367 | + bansheePreferences.checkrow(self.TBL, row, 1) |
368 | + else: |
369 | + bansheePreferences.uncheckrow(self.TBL, row, 1) |
370 | + row+=1 |
371 | + |
372 | + bansheePreferences.getchild(self.BTN_CLOSE).click() |
373 | + ldtp.wait(2) |
374 | + ldtp.waittillguiexist(self.WINDOW) |
375 | + |
376 | + def banshee_add_podcast(self, podcast_url): |
377 | + banshee = ooldtp.context(self.WINDOW) |
378 | + |
379 | + if not banshee.doesrowexist(self.TBL, 'Podcasts'): |
380 | + raise AssertionError, "The Podcast plugin was either not activated or crashed during the activation" |
381 | + |
382 | + #select the podcast entry on the left side listview. |
383 | + banshee.selectrow(self.TBL, 'Podcasts') |
384 | + ldtp.wait() |
385 | + #remap the window since new buttons appear on it. |
386 | + ldtp.remap(self.WINDOW) |
387 | + banshee.getchild(self.BTN_ADDPODCAST).click() |
388 | + ldtp.waittillguiexist(self.DLG_SUBSCRIBE) |
389 | + subscribe = ooldtp.context(self.DLG_SUBSCRIBE) |
390 | + subscribe.settextvalue(self.TXT_0, podcast_url) |
391 | + ldtp.wait(2) |
392 | + subscribe.getchild(self.BTN_SUBSCRIBE).click() |
393 | + ldtp.waittillguiexist(self.WINDOW, self.BTN_STOP) |
394 | + #the btnStop and it dialog appear just when adding the podcast |
395 | + #so the ui needs to be remaped in order to track the progress. |
396 | + ldtp.remap(self.WINDOW) |
397 | + buttonStop = banshee.getchild(self.BTN_STOP) |
398 | + |
399 | + while buttonStop.stateenabled(): |
400 | + ldtp.wait() |
401 | + |
402 | + if not banshee.getrowcount(self.TBL_LISTVIEW) > 1: |
403 | + raise AssertionError, "The Podcast: %s was not added" % podcast_url |
404 | + |
405 | + def banshee_import_playlist(self, playlist_path): |
406 | + banshee = ooldtp.context(self.WINDOW) |
407 | + banshee.getchild(self.MNU_IMPORTPLAYLIST).selectmenuitem() |
408 | + |
409 | + ldtp.wait(2) |
410 | + |
411 | + if (ldtp.guiexist(self.DLG_IMPORTPLAYLIST)): |
412 | + selectPlaylist = ooldtp.context(self.DLG_IMPORTPLAYLIST) |
413 | + if not (selectPlaylist.getchild(self.TXT_LOCATION)): |
414 | + ldtp.generatekeyevent('<ctrl>l') |
415 | + |
416 | + selectPlaylist.settextvalue(self.TXT_LOCATION, playlist_path) |
417 | + ldtp.wait(2) |
418 | + selectPlaylist.getchild(self.BTN_IMPORT).click() |
419 | + ldtp.wait(2) |
420 | + |
421 | + ldtp.waittillguiexist(self.WINDOW) |
422 | + playlistName = os.path.splitext(os.path.basename(playlist_path))[0] |
423 | + |
424 | + if not banshee.doesrowexist(self.TBL, playlistName): |
425 | + raise AssertionError, "The playlist %s was not imported into Banshee." % playlist_path |
426 | + |
427 | + def banshee_play_file(self, file_path, tmp_path): |
428 | + banshee = ooldtp.context(self.WINDOW) |
429 | + banshee.getchild(self.MNU_OPENLOCATION).selectmenuitem() |
430 | + ldtp.wait() |
431 | + |
432 | + bansheeLocation = ooldtp.context(self.DLG_OPENLOCATION) |
433 | + |
434 | + bansheeLocation.getchild(self.BTN_BROWSE).click() |
435 | + |
436 | + ldtp.waittillguiexist(self.DLG_OPENLOCATION_1) |
437 | + location = ooldtp.context(self.DLG_OPENLOCATION_1) |
438 | + |
439 | + if not (location.guiexist(self.TXT_LOCATION)): |
440 | + ldtp.generatekeyevent('<ctrl>l') |
441 | + location.settextvalue(self.TXT_LOCATION, file_path) |
442 | + ldtp.wait(2) |
443 | + location.getchild(self.BTN_OPEN).click() |
444 | + ldtp.wait(2) |
445 | + |
446 | + bansheeLocation.getchild(self.BTN_OPEN).click() |
447 | + ldtp.waittillguiexist(self.WINDOW_PLAY) |
448 | + totem = Totem() |
449 | + (freq, flat) = totem.capture_do_fft(tmp_path) |
450 | + |
451 | + if freq != 440: |
452 | + raise AssertionError, "Sine WAV playback error, frq expected: 440; got %s" % freq |
453 | + os.unlink(tmp_path) |
454 | + os.unlink(file_path) |
455 | + |
456 | + def create_wav_file(self, freq, wavfile): |
457 | + pipeline = 'audiotestsrc freq=%d num-buffers=512 ! queue ! \ |
458 | + audioconvert ! \ |
459 | + audio/x-raw-int,width=16,depth=16,channels=1 ! \ |
460 | + wavenc ! \ |
461 | + filesink location=%s' % (freq, wavfile) |
462 | + element = gst.parse_launch(pipeline) |
463 | + element.set_state(gst.STATE_PLAYING) |
464 | + |
465 | + def banshee_miro_guide(self): |
466 | + banshee = ooldtp.context(self.WINDOW) |
467 | + |
468 | + if not banshee.doesrowexist(self.TBL, 'Miro Guide'): |
469 | + raise AssertionError, "The Miro Guide plugin was either not activated or crashed during the activation" |
470 | + |
471 | + #select the podcast entry on the left side listview. |
472 | + banshee.selectrow(self.TBL, 'Miro Guide') |
473 | + ldtp.wait() |
474 | + #remap the window since new buttons appear on it. |
475 | + ldtp.remap(self.WINDOW) |
476 | + buttonHome = banshee.getchild(self.BTN_HOME) |
477 | + while not buttonHome.stateenabled(): |
478 | + ldtp.wait() |
479 | + |
480 | + banshee.selectrow(self.TBL, 'Music') |
481 | + |
482 | + def banshee_create_smart_playlist(self, playlist_name, artist): |
483 | + banshee = ooldtp.context(self.WINDOW) |
484 | + banshee.getchild(self.MNU_NEWSMARTPLAYLIST).selectmenuitem() |
485 | + |
486 | + ldtp.waittillguiexist(self.DLG_SMARTPLAYLIST) |
487 | + smartPlaylist = ooldtp.context(self.DLG_SMARTPLAYLIST) |
488 | + smartPlaylist.settextvalue(self.TXT_0, playlist_name) |
489 | + smartPlaylist.settextvalue(self.TXT_1, artist) |
490 | + comboAlbum = smartPlaylist.getchild(self.CBO_ALBUM) |
491 | + comboAlbum.comboselect('Artist') |
492 | + |
493 | + smartPlaylist.getchild(self.BTN_SAVE).click() |
494 | + |
495 | + if not banshee.doesrowexist(self.TBL, playlist_name): |
496 | + raise AssertionError, "The playlist %s was not created." % playlist_name |
497 | + |
498 | + def __init__(self): |
499 | + Application.__init__(self) |
500 | + self.main_window = ooldtp.context(self.WINDOW) |
501 | |
502 | === added file 'mago/test_suite/banshee.py' |
503 | --- mago/test_suite/banshee.py 1970-01-01 00:00:00 +0000 |
504 | +++ mago/test_suite/banshee.py 2010-11-26 11:36:12 +0000 |
505 | @@ -0,0 +1,30 @@ |
506 | +""" |
507 | +This module contains the definition of the test suite for Banshee testing. |
508 | +""" |
509 | +import ldtp, ooldtp |
510 | +import os |
511 | +import shutil |
512 | +from .main import SingleApplicationTestSuite |
513 | +from ..application.banshee import Application, Banshee |
514 | + |
515 | +class Banshee_TestSuite(SingleApplicationTestSuite): |
516 | + """ |
517 | + Default test suite for Banshee |
518 | + """ |
519 | + APPLICATION_FACTORY = Banshee |
520 | + def setup(self): |
521 | + self.application.open() |
522 | + |
523 | + def teardown(self): |
524 | + if not ldtp.guiexist('frmBansheeMediaPlayer'): |
525 | + self.application.set_name('frmbanshee*') |
526 | + |
527 | + #remove banshee config since we imported playlists, etc. |
528 | + banshee_config = os.getenv('HOME') + '/.config/banshee-1' |
529 | + if os.path.exists(banshee_config): |
530 | + shutil.rmtree(banshee_config) |
531 | + |
532 | + self.application.close() |
533 | + |
534 | + def cleanup(self): |
535 | + pass |
+ if not ldtp.guiexist( 'frmBansheeMedi aPlayer' ): n.set_name( 'frmbanshee* ')
+ self.applicatio
Maybe you can use the names from definition, if they doesn't exist, maybe we can define it !
Thanks