Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
add non-sub search test
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-weber committed Nov 13, 2016
1 parent ea51862 commit f3bed4b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gmusicapi/test/server_tests.py
Expand Up @@ -970,6 +970,7 @@ def mc_list_IFL_station_tracks(self):
1)

@test(groups=['search'])
@subscription
def mc_search_store_no_playlists(self):
res = self.mc.search('morning', max_results=100)

Expand All @@ -980,6 +981,20 @@ def mc_search_store_no_playlists(self):
for type_, hits in res.items():
check.true(len(hits) > 0, "%s had %s hits, expected > 0" % (type_, len(hits)))

@test(groups=['search'])
def mc_search_store_no_playlists_no_sub(self):
res = self.mc.search('morning', max_results=100)

res.pop('playlist_hits')

with Check() as check:
for type_, hits in res.items():
if type_ in ('artist_hits', 'song_hits', 'album_hits'):
# These results aren't returned for non-sub accounts.
check.true(len(hits) == 0, "%s had %s hits, expected 0" % (type_, len(hits)))
else:
check.true(len(hits) > 0, "%s had %s hits, expected > 0" % (type_, len(hits)))

@test
def mc_artist_info(self):
aid = 'Apoecs6off3y6k4h5nvqqos4b5e' # amorphis
Expand Down

0 comments on commit f3bed4b

Please sign in to comment.