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