Merge lp:~submarine/unity-scope-clementine/clementine-previews into lp:unity-scope-clementine

Proposed by Mark Tully
Status: Merged
Approved by: David Callé
Approved revision: 32
Merged at revision: 23
Proposed branch: lp:~submarine/unity-scope-clementine/clementine-previews
Merge into: lp:unity-scope-clementine
Diff against target: 513 lines (+157/-233)
3 files modified
data/clementine.scope.in (+1/-1)
src/unity_clementine_daemon.py (+144/-220)
tests/test_clementine.py (+12/-12)
To merge this branch: bzr merge lp:~submarine/unity-scope-clementine/clementine-previews
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
David Callé Approve
Review via email: mp+159933@code.launchpad.net

Commit message

Add Previews and Activation.

Description of the change

Add Previews and Activation.

Now using SQL queries to do the searching rather than using SQL to grab everything and then searching within the scope

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
David Callé (davidc3) wrote :

Lookgs good. +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity-scope-clementine-autolanding/2/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-clementine-raring-amd64-autolanding/2

review: Needs Fixing (continuous-integration)
Revision history for this message
David Callé (davidc3) wrote :

Jenkins hiccup. Approved again.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/clementine.scope.in'
--- data/clementine.scope.in 2013-03-20 16:43:38 +0000
+++ data/clementine.scope.in 2013-04-22 13:02:11 +0000
@@ -5,7 +5,7 @@
5QueryBinary=clementine5QueryBinary=clementine
6_Keywords=clementine;6_Keywords=clementine;
7RequiredMetadata=7RequiredMetadata=
8OptionalMetadata=8OptionalMetadata=album[s];artist[s];genre[s];year[i];track_length[i];track_number[i]
9Loader=/usr/share/unity-scopes/clementine/unity_clementine_daemon.py9Loader=/usr/share/unity-scopes/clementine/unity_clementine_daemon.py
10RemoteContent=false10RemoteContent=false
11Type=music11Type=music
1212
=== modified file 'src/unity_clementine_daemon.py'
--- src/unity_clementine_daemon.py 2013-03-19 15:40:44 +0000
+++ src/unity_clementine_daemon.py 2013-04-22 13:02:11 +0000
@@ -18,14 +18,11 @@
18from gi.repository import Unity18from gi.repository import Unity
19import gettext19import gettext
20import urllib.parse20import urllib.parse
21import dbus
22import hashlib21import hashlib
23import unicodedata22import unicodedata
24import os23import os
25import sys
26import shutil24import shutil
27import sqlite325import sqlite3
28import dbus
2926
30APP_NAME = 'unity-scope-clementine'27APP_NAME = 'unity-scope-clementine'
31LOCAL_PATH = '/usr/share/locale/'28LOCAL_PATH = '/usr/share/locale/'
@@ -45,7 +42,7 @@
45DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'42DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'
46DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL43DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL
47CLEMENTINE_DBFILE = os.getenv("HOME") + "/.config/Clementine/clementine.db"44CLEMENTINE_DBFILE = os.getenv("HOME") + "/.config/Clementine/clementine.db"
48CLEMENTIME_BACKUP_FILE = os.getenv("HOME") + "/.config/Clementine/clementine-scope-backup.db"45CLEMENTINE_BACKUP_FILE = os.getenv("HOME") + "/.config/Clementine/clementine-scope-backup.db"
4946
50c1 = {'id': 'songs',47c1 = {'id': 'songs',
51 'name': _('Songs'),48 'name': _('Songs'),
@@ -59,66 +56,64 @@
5956
60FILTERS = []57FILTERS = []
6158
62m1 = {'id' :'album',59m1 = {'id': 'album',
63 'type' :'s',60 'type': 's',
64 'field':Unity.SchemaFieldType.OPTIONAL}61 'field': Unity.SchemaFieldType.OPTIONAL}
65m2 = {'id' :'artist',62m2 = {'id': 'artist',
66 'type' :'s',63 'type': 's',
67 'field':Unity.SchemaFieldType.OPTIONAL}64 'field': Unity.SchemaFieldType.OPTIONAL}
68m3 = {'id' :'genre',65m3 = {'id': 'genre',
69 'type' :'s',66 'type': 's',
70 'field':Unity.SchemaFieldType.OPTIONAL}67 'field': Unity.SchemaFieldType.OPTIONAL}
71m4 = {'id' :'year',68m4 = {'id': 'year',
72 'type' :'i',69 'type': 'i',
73 'field':Unity.SchemaFieldType.OPTIONAL}70 'field': Unity.SchemaFieldType.OPTIONAL}
74EXTRA_METADATA = [m1, m2, m3, m4]71m5 = {'id': 'track_length',
7572 'type': 'i',
76REFRESH_TIMEOUT = 30073 'field': Unity.SchemaFieldType.OPTIONAL}
77PREVIEW_PLAYER_DBUS_NAME = "com.canonical.Unity.Lens.Music.PreviewPlayer"74m6 = {'id': 'track_number',
78PREVIEW_PLAYER_DBUS_PATH = "/com/canonical/Unity/Lens/Music/PreviewPlayer"75 'type': 'i',
79PREVIEW_PLAYER_DBUS_IFACE = PREVIEW_PLAYER_DBUS_NAME76 'field': Unity.SchemaFieldType.OPTIONAL}
8077EXTRA_METADATA = [m1, m2, m3, m4, m5, m6]
81tracks = []78
8279SEARCH_SQL = '''SELECT title, filename, artist, album, albumartist, art_automatic, year, genre, art_manual, track, length
8380 FROM songs
84def get_music_from_clementine():81 WHERE album LIKE '%%%s%%' OR artist LIKE '%%%s%%' OR title LIKE '%%%s%%' ORDER BY track'''
85 '''82
86 Parses Clementine's database into a form we can use83ALBUM_SQL = '''SELECT title, filename, artist, album, albumartist, art_automatic, year, genre, art_manual, track, length
87 '''84 FROM songs
88 # Copy clementine's database to a backup so we can run searches on that rather than the main database85 WHERE album LIKE '%%%s%%' AND artist LIKE '%%%s%%' ORDER BY track'''
86
87
88def get_music_from_clementine(query):
89 '''
90 Parses Clementine's database into a form we can use using the supplied SQL query
91 '''
89 tracks = []92 tracks = []
90 if not os.path.exists(CLEMENTINE_DBFILE):93 if not os.path.exists(CLEMENTINE_BACKUP_FILE):
91 return tracks94 return tracks
9295
93 shutil.copy2(CLEMENTINE_DBFILE, CLEMENTIME_BACKUP_FILE)96 conn = sqlite3.connect(CLEMENTINE_BACKUP_FILE)
94
95 # Grab all the data we need from the backup
96 conn = sqlite3.connect(CLEMENTIME_BACKUP_FILE)
97 cursor = conn.cursor()97 cursor = conn.cursor()
98 # Go through the safe and grab track names, their uris, the artist name, the album title and the track's mimetypes98 cursor.execute(query)
99 # We'll have to call them all mp3s as the mimetype isn't explicitly in the database, but as long as it's an audio mimetype, it shouldn't matter
100 cursor.execute('''SELECT title, filename, artist, album, "taglib/mp3", albumartist, art_automatic, year, genre, art_manual, track, length
101 FROM songs
102 ORDER BY track''')
103 tracks = cursor.fetchall()99 tracks = cursor.fetchall()
104 cursor.close()100 cursor.close()
105 print("Updated tracks from Clementine database")
106 return tracks101 return tracks
107102
108103
109def get_album_art(track):104def get_album_art(track):
110 # First try manually set album art105 # First try manually set album art
111 if not track[9] is None:106 if not track[8] is None:
112 if not track[9] == "(embedded)":107 if not track[8] == "(embedded)":
113 return track[9]108 return track[8]
114109
115 # Next try automatically set album art110 # Next try automatically set album art
116 if not track[6] is None:111 if not track[5] is None:
117 if not track[6] == "(embedded)":112 if not track[5] == "(embedded)":
118 return track[6]113 return track[5]
119114
120 # Try thumbnailing any embedded album art and use that115 # Try thumbnailing any embedded album art and use that
121 hashname = '%s\t%s' % (unicodedata.normalize("NFKD", track[5]), unicodedata.normalize("NFKD", track[3]))116 hashname = '%s\t%s' % (unicodedata.normalize("NFKD", track[4]), unicodedata.normalize("NFKD", track[3]))
122 file_hash = hashlib.md5(hashname.encode('utf-8')).hexdigest()117 file_hash = hashlib.md5(hashname.encode('utf-8')).hexdigest()
123 tb_filename = os.path.join(os.path.expanduser("~/.cache/media-art"), ("album-" + file_hash)) + ".jpg"118 tb_filename = os.path.join(os.path.expanduser("~/.cache/media-art"), ("album-" + file_hash)) + ".jpg"
124 if os.path.exists(tb_filename):119 if os.path.exists(tb_filename):
@@ -149,171 +144,81 @@
149 Search for help documents matching the search string144 Search for help documents matching the search string
150 '''145 '''
151 results = []146 results = []
152 tracks = get_music_from_clementine()147 shutil.copy2(CLEMENTINE_DBFILE, CLEMENTINE_BACKUP_FILE)
153 trackresults = []148 tracks = get_music_from_clementine(SEARCH_SQL % (search, search, search))
154 albumresults = []149 albumresults = []
155150
156 for track in tracks:151 for track in tracks:
157 title = u"" if track[0] is None else track[0]152 title = "" if track[0] is None else track[0]
158 uri = u"" if track[1] is None else track[1]153 uri = "" if track[1] is None else track[1].decode('utf-8')
159 artist = u"" if track[2] is None else track[2]154 artist = "" if track[2] is None else track[2]
160 album = u"" if track[3] is None else track[3]155 album = "" if track[3] is None else track[3]
161 mimetype = u"" if track[4] is None else track[4]156 albumartist = "" if track[4] is None else track[4]
162 albumartist = u"" if track[5] is None else track[5]157 year = 0 if track[6] is None else track[6]
163 year = 0 if track[7] is None else track[7]158 genre = "" if track[7] is None else track[7]
164 genre = u"" if track[8] is None else track[8]159 track_length = 0 if track[10] is None else track[10] / 1000000000
165 trackname = title + u" - " + album + u" - " + artist160 track_number = 0 if track[9] is None else track[9]
166 if search.lower() in trackname.lower():161
167 albumart = get_album_art(track)162 albumart = get_album_art(track)
168 albumuri = "album://" + albumartist + "/" + album163 albumuri = "album://" + albumartist + "/" + album
169 if track not in trackresults:164 results.append({'uri': urllib.parse.unquote(uri),
170 results.append({'uri': uri.decode('utf-8'),165 'icon': albumart,
171 'icon': albumart,166 'category': 0,
172 'category': 0,167 'title': title,
173 'mimetype': mimetype,168 'album': GLib.Variant('s', album),
174 'title': title,169 'artist': GLib.Variant('s', artist),
175 'comment': artist,170 'genre': GLib.Variant('s', genre),
176 'album':GLib.Variant('s', album),171 'year': GLib.Variant('i', year),
177 'artist':GLib.Variant('s', artist),172 'track_length': GLib.Variant('i', track_length),
178 'genre':GLib.Variant('s', genre),173 'track_number': GLib.Variant('i', track_number)})
179 'year':GLib.Variant('i', year)})174
180 trackresults.append(track)175 if album not in albumresults:
181176 results.append({'uri': albumuri,
182 if album not in albumresults:177 'icon': albumart,
183 results.append({'uri': albumuri,178 'category': 1,
184 'icon': albumart,179 'title': album,
185 'category': 1,180 'album': GLib.Variant('s', album),
186 'mimetype': mimetype,181 'artist': GLib.Variant('s', artist),
187 'title': album,182 'genre': GLib.Variant('s', genre),
188 'comment': artist,183 'year': GLib.Variant('i', year)})
189 'album':GLib.Variant('s', album),184 albumresults.append(album)
190 'artist':GLib.Variant('s', artist),
191 'genre':GLib.Variant('s', genre),
192 'year':GLib.Variant('i', year)})
193 albumresults.append(album)
194 return results185 return results
195186
196187
197def activate(scope, uri):188class Preview(Unity.ResultPreviewer):
198 import subprocess189
199 albumtracks = []190 def do_run(self):
200 albumtracks.append("clementine")191 album = self.result.metadata['album'].get_string()
201 albumtracks.append("-a")192 artist = self.result.metadata['artist'].get_string()
202 # If uri starts with album:// then we need to play all the songs on it193 preview = Unity.MusicPreview.new(self.result.title, '', None)
203 if uri.startswith("album://"):194 preview.props.image_source_uri = 'file://%s' % self.result.icon_hint
204 for track in tracks:195 preview.props.subtitle = self.result.metadata['artist'].get_string()
205 album = "album://" + track[5] + "/" + track[3]196 if self.result.uri.startswith("album://"):
206 if not album.find(uri) == -1:197 tracks = get_music_from_clementine(ALBUM_SQL % (album, artist))
207 albumtrack = urllib.parse.unquote(str(track[1]))198 for track in tracks:
208 albumtracks.append(albumtrack)199 track = Unity.TrackMetadata.full(track[1].decode('utf-8'),
209 subprocess.Popen(albumtracks)200 track[9],
210 else:201 track[0],
211 albumtracks.append(uri)202 track[2],
212 subprocess.Popen(albumtracks)203 track[3],
213 return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri='')204 track[10] / 1000000000)
214
215
216def show_in_folder(scope, uri):
217 """ Shows the folder containing the selected track as requested from the Preview
218 """
219 if uri.startswith("album://"):
220 for track in tracks:
221 album = "album://" + track[2] + "/" + track[3]
222 if not album.find(uri) == -1:
223 filename = track[1]
224 continue
225 else:
226 filename = uri
227 dirname = os.path.dirname(filename)
228 dirname = dirname.replace("%20", "\ ")
229 os.system("xdg-open '%s'" % str(dirname))
230 return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri='')
231
232
233def preview_uri(scope, uri):
234 """Preview request handler"""
235 albumtracks = []
236 isalbum = False
237 if uri.startswith("album://"):
238 isalbum = True
239 for track in tracks:
240 album = "album://" + track[2] + "/" + track[3]
241 if not album.find(uri) == -1:
242 albumtracks.append(track)
243 albumtracks.sort(key=lambda track: int(track[7]))
244 else:
245 for track in tracks:
246 album = "file://" + track[1]
247 if not album.find(uri) == -1:
248 albumtracks.append(track)
249 iteration = model.get_first_iter()
250 end_iter = model.get_last_iter()
251 while iteration != end_iter:
252 if model.get_value(iteration, 0) == uri:
253 title = model.get_value(iteration, 5)
254 description = model.get_value(iteration, 6)
255 if model.get_value(iteration, 1) == "musique":
256 image = "file:///usr/share/icons/hicolor/scalable/apps/audacious.svg"
257 else:
258 image = "file://%s" % model.get_value(iteration, 1)
259
260 preview = Unity.MusicPreview.new(title, description, None)
261 preview.props.image_source_uri = image
262 for albumtrack in albumtracks:
263 if isalbum:
264 track = Unity.TrackMetadata.full("file://" + urllib.parse.unquote(str(albumtrack[1])), # uri
265 int(albumtrack[7]), # track number
266 albumtrack[0], # track title
267 albumtrack[2], # artist
268 albumtrack[3], # album
269 int(albumtrack[8]) / 1000) # track length
270 else:
271 preview = Unity.MusicPreview.new(albumtrack[0], "", None)
272 preview.props.image_source_uri = image
273 track = Unity.TrackMetadata.full("file://" + urllib.parse.unquote(str(albumtrack[1])),
274 int(albumtrack[7]),
275 albumtrack[0],
276 albumtrack[2],
277 albumtrack[3],
278 int(albumtrack[8]) / 1000)
279 preview.add_track(track)205 preview.add_track(track)
280206 else:
281 # Add the "Play" action207 track = Unity.TrackMetadata.full(self.result.uri,
282 play_action = Unity.PreviewAction.new("activate_uri", "Play", None)208 self.result.metadata['track_number'].get_int32(),
283 play_action.connect("activated", activate)209 self.result.title,
284 preview.add_action(play_action)210 self.result.metadata['artist'].get_string(),
285211 self.result.metadata['album'].get_string(),
286 # Add the "Show in folder" action212 self.result.metadata['track_length'].get_int32())
287 show_action = Unity.PreviewAction.new("show_in_folder", "Show In Folder", None)213 preview.add_track(track)
288 show_action.connect("activated", show_in_folder)214
289 preview.add_action(show_action)215 icon = Gio.FileIcon.new(Gio.file_new_for_path(PROVIDER_ICON))
290216 view_action = Unity.PreviewAction.new("play", _("Play"), None)
291 preview.connect("play", play)217 preview.add_action(view_action)
292 preview.connect("pause", pause)218 show_action = Unity.PreviewAction.new("show", _("Show in Folder"), None)
293 preview.connect("closed", closed)219 preview.add_action(show_action)
294 break220 return preview
295 iteration = model.next(iteration)221
296 if preview is None:
297 print("Couldn't find model row for requested preview uri: '%s'", uri)
298 return preview
299
300
301def play(preview, uri):
302 """Plays the selected track as selected in the Preview"""
303 player = self.bus.get_object(PREVIEW_PLAYER_DBUS_NAME, PREVIEW_PLAYER_DBUS_PATH)
304 dbus.Interface(player, PREVIEW_PLAYER_DBUS_IFACE).Play(uri)
305
306
307def pause(preview, uri):
308 """Pauses the selected track as selected in the Preview"""
309 player = self.bus.get_object(PREVIEW_PLAYER_DBUS_NAME, PREVIEW_PLAYER_DBUS_PATH)
310 dbus.Interface(player, PREVIEW_PLAYER_DBUS_IFACE).Pause()
311
312
313def closed(preview):
314 """Stops playing when the previre is closed"""
315 player = self.bus.get_object(PREVIEW_PLAYER_DBUS_NAME, PREVIEW_PLAYER_DBUS_PATH)
316 dbus.Interface(player, PREVIEW_PLAYER_DBUS_IFACE).Close()
317222
318# Classes below this point establish communication223# Classes below this point establish communication
319# with Unity, you probably shouldn't modify them.224# with Unity, you probably shouldn't modify them.
@@ -348,19 +253,8 @@
348 i['comment'] = ''253 i['comment'] = ''
349 if not 'dnd_uri' in i or not i['dnd_uri'] or i['dnd_uri'] == '':254 if not 'dnd_uri' in i or not i['dnd_uri'] or i['dnd_uri'] == '':
350 i['dnd_uri'] = i['uri']255 i['dnd_uri'] = i['uri']
351 i['metadata'] = {}256 i['provider_credits'] = GLib.Variant('s', PROVIDER_CREDITS)
352 if EXTRA_METADATA:257 result_set.add_result(**i)
353 for e in i:
354 for m in EXTRA_METADATA:
355 if m['id'] == e:
356 i['metadata'][e] = i[e]
357 i['metadata']['provider_credits'] = GLib.Variant('s', PROVIDER_CREDITS)
358 result = Unity.ScopeResult.create(str(i['uri']), str(i['icon']),
359 i['category'], i['result_type'],
360 str(i['mimetype']), str(i['title']),
361 str(i['comment']), str(i['dnd_uri']),
362 i['metadata'])
363 result_set.add_result(result)
364 except Exception as error:258 except Exception as error:
365 print(error)259 print(error)
366260
@@ -416,6 +310,36 @@
416 se = MySearch(search_context)310 se = MySearch(search_context)
417 return se311 return se
418312
313 def do_activate(self, result, metadata, id):
314 album = result.metadata['album'].get_string()
315 artist = result.metadata['artist'].get_string()
316
317 if id == 'show':
318 if result.uri.startswith("album://"):
319 tracks = get_music_from_clementine(ALBUM_SQL % (album, artist))
320 filename = tracks[0][1].decode('utf-8')
321 else:
322 filename = result.uri
323 dirname = os.path.dirname(filename)
324 os.system("xdg-open '%s'" % str(dirname))
325 else:
326 albumtracks = ''
327 if result.uri.startswith('album://'):
328 tracks = get_music_from_clementine(ALBUM_SQL % (album, artist))
329 for track in tracks:
330 albumtracks = '%s \'%s\'' % (albumtracks, track[1].decode('utf-8'))
331 else:
332 albumtracks = result.uri
333 os.system('clementine -a %s' % albumtracks)
334
335 return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri=None)
336
337 def do_create_previewer(self, result, metadata):
338 rp = Preview()
339 rp.set_scope_result(result)
340 rp.set_search_metadata(metadata)
341 return rp
342
419343
420def load_scope():344def load_scope():
421 return Scope()345 return Scope()
422346
=== modified file 'tests/test_clementine.py'
--- tests/test_clementine.py 2013-02-18 15:48:48 +0000
+++ tests/test_clementine.py 2013-04-22 13:02:11 +0000
@@ -11,17 +11,18 @@
11 self.results = []11 self.results = []
1212
13 def do_add_result(self, result):13 def do_add_result(self, result):
14 self.results.append({'uri':result.uri,14 self.results.append({'uri': result.uri,
15 'title':result.title,15 'title': result.title,
16 'comment':result.comment,16 'comment': result.comment,
17 'icon':result.icon_hint})17 'icon': result.icon_hint})
18
1819
19class ScopeTestCase(TestCase):20class ScopeTestCase(TestCase):
20 def init_scope(self, scope_path):21 def init_scope(self, scope_path):
21 self.scope_module = imp.load_source('scope', scope_path)22 self.scope_module = imp.load_source('scope', scope_path)
22 self.scope = self.scope_module.load_scope()23 self.scope = self.scope_module.load_scope()
2324
24 def perform_query(self, query, filter_set = Unity.FilterSet.new()):25 def perform_query(self, query, filter_set=Unity.FilterSet.new()):
25 result_set = ResultSet()26 result_set = ResultSet()
26 ctx = Unity.SearchContext.create(query, 0, filter_set,27 ctx = Unity.SearchContext.create(query, 0, filter_set,
27 None, result_set, None)28 None, result_set, None)
@@ -30,7 +31,7 @@
30 return result_set31 return result_set
3132
3233
33class TestAskUbuntu(ScopeTestCase):34class TestClementine(ScopeTestCase):
34 def setUp(self):35 def setUp(self):
35 self.init_scope('src/unity_clementine_daemon.py')36 self.init_scope('src/unity_clementine_daemon.py')
3637
@@ -38,10 +39,10 @@
38 self.scope = None39 self.scope = None
39 self.scope_module = None40 self.scope_module = None
4041
41 def test_questions_search(self):42 def test_search(self):
42 self.scope_module.CLEMENTINE_DBFILE = 'tests/data/mock_clementine_pass.db'43 self.scope_module.CLEMENTINE_DBFILE = 'tests/data/mock_clementine_pass.db'
43 self.scope_module.CLEMENTIME_BACKUP_FILE = 'tests/data/mock_clementine_backup.db'44 self.scope_module.CLEMENTINE_BACKUP_FILE = 'tests/data/mock_clementine_backup.db'
44 expected_results = ["file:///home/mark/Music/Bell%20X1/Flock/01.%20Reacharound.mp3",45 expected_results = ["file:///home/mark/Music/Bell X1/Flock/01. Reacharound.mp3",
45 "Reacharound",46 "Reacharound",
46 "album://Bell X1/Flock",47 "album://Bell X1/Flock",
47 "Flock"]48 "Flock"]
@@ -54,10 +55,9 @@
54 results.append(result_set.results[1]['title'])55 results.append(result_set.results[1]['title'])
55 self.assertEqual(results, expected_results)56 self.assertEqual(results, expected_results)
5657
5758 def test_failing_search(self):
58 def test_questions_failing_search(self):
59 self.scope_module.CLEMENTINE_DBFILE = 'tests/data/mock_clementine_fail'59 self.scope_module.CLEMENTINE_DBFILE = 'tests/data/mock_clementine_fail'
60 self.scope_module.CLEMENTIME_BACKUP_FILE = 'tests/data/mock_clementine_backup.db'60 self.scope_module.CLEMENTINE_BACKUP_FILE = 'tests/data/mock_clementine_backup.db'
61 for s in ['upnriitnyt']:61 for s in ['upnriitnyt']:
62 result_set = self.perform_query(s)62 result_set = self.perform_query(s)
63 self.assertEqual(len(result_set.results), 0)63 self.assertEqual(len(result_set.results), 0)

Subscribers

People subscribed via source and target branches

to all changes: