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

Commit

Permalink
disable webclient tests [#395]
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-weber committed Jan 10, 2016
1 parent c792a77 commit 5b939e2
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions gmusicapi/test/server_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def mc_get_playlist_songs(self, plid):

@before_class
def login(self):
self.wc = test_utils.new_test_client(Webclient)
assert_true(self.wc.is_authenticated())
# self.wc = test_utils.new_test_client(Webclient)
# assert_true(self.wc.is_authenticated())

self.mm = test_utils.new_test_client(Musicmanager)
assert_true(self.mm.is_authenticated())
Expand All @@ -148,9 +148,9 @@ def login(self):

@after_class(always_run=True)
def logout(self):
if self.wc is None:
raise SkipTest('did not create wc')
assert_true(self.wc.logout())
# if self.wc is None:
# raise SkipTest('did not create wc')
# assert_true(self.wc.logout())

if self.mm is None:
raise SkipTest('did not create mm')
Expand Down Expand Up @@ -272,18 +272,18 @@ def song_create(self):
@test
def playlist_create(self):
mc_id = self.mc.create_playlist(TEST_PLAYLIST_NAME, "", public=True)
wc_id = self.wc.create_playlist(TEST_PLAYLIST_NAME, "", public=True)
# wc_id = self.wc.create_playlist(TEST_PLAYLIST_NAME, "", public=True)

# like song_create, retry until the playlist appears
@retry
def assert_playlist_exists(plids):
found = [p for p in self.mc.get_all_playlists()
if p['id'] in plids]

assert_equal(len(found), 2)
assert_equal(len(found), 1)

assert_playlist_exists([mc_id, wc_id])
self.playlist_ids = [mc_id, wc_id]
assert_playlist_exists([mc_id])
self.playlist_ids = [mc_id]

@test(depends_on=[playlist_create, song_create],
runs_after_groups=['playlist.exists', 'song.exists'])
Expand Down Expand Up @@ -417,7 +417,7 @@ def song_delete(self):
# mc is the only to run if AA testing not enabled
with Check() as check:
for i, testsong in enumerate(self.all_songs):
if i % 2 == 0:
if True:
res = self.mc.delete_songs(testsong.sid)
else:
with warnings.catch_warnings():
Expand Down Expand Up @@ -474,68 +474,68 @@ def assert_download(sid):
# WC tests
# ---------

@test
def wc_get_registered_devices(self):
# no logic; just checking schema
self.wc.get_registered_devices()
# @test
# def wc_get_registered_devices(self):
# # no logic; just checking schema
# self.wc.get_registered_devices()

@test
def wc_get_shared_playlist_info(self):
expected = {
u'author': u'gmusic api',
u'description': u'description here',
u'title': u'public title here',
u'num_tracks': 2
}

assert_equal(
self.wc.get_shared_playlist_info(TEST_PLAYLIST_SHARETOKEN),
expected
)
# @test
# def wc_get_shared_playlist_info(self):
# expected = {
# u'author': u'gmusic api',
# u'description': u'description here',
# u'title': u'public title here',
# u'num_tracks': 2
# }

# assert_equal(
# self.wc.get_shared_playlist_info(TEST_PLAYLIST_SHARETOKEN),
# expected
# )

@test
@all_access
def wc_get_aa_stream_urls(self):
urls = self.wc.get_stream_urls(TEST_AA_SONG_ID)
# @test
# @all_access
# def wc_get_aa_stream_urls(self):
# urls = self.wc.get_stream_urls(TEST_AA_SONG_ID)

assert_true(len(urls) > 1)
# assert_true(len(urls) > 1)

@test
@all_access
def wc_stream_aa_track_with_header(self):
audio = self.wc.get_stream_audio(TEST_AA_SONG_ID, use_range_header=True)
# @test
# @all_access
# def wc_stream_aa_track_with_header(self):
# audio = self.wc.get_stream_audio(TEST_AA_SONG_ID, use_range_header=True)

assert_equal(md5(audio).hexdigest(), TEST_AA_SONG_WC_HASH)
# assert_equal(md5(audio).hexdigest(), TEST_AA_SONG_WC_HASH)

@test
@all_access
def wc_stream_aa_track_without_header(self):
audio = self.wc.get_stream_audio(TEST_AA_SONG_ID, use_range_header=False)
# @test
# @all_access
# def wc_stream_aa_track_without_header(self):
# audio = self.wc.get_stream_audio(TEST_AA_SONG_ID, use_range_header=False)

assert_equal(md5(audio).hexdigest(), TEST_AA_SONG_WC_HASH)
# assert_equal(md5(audio).hexdigest(), TEST_AA_SONG_WC_HASH)

@song_test
def wc_get_download_info(self):
url, download_count = self.wc.get_song_download_info(self.user_songs[0].sid)
# @song_test
# def wc_get_download_info(self):
# url, download_count = self.wc.get_song_download_info(self.user_songs[0].sid)

assert_is_not_none(url)
# assert_is_not_none(url)

@song_test
def wc_get_uploaded_stream_urls(self):
urls = self.wc.get_stream_urls(self.user_songs[0].sid)
# @song_test
# def wc_get_uploaded_stream_urls(self):
# urls = self.wc.get_stream_urls(self.user_songs[0].sid)

assert_equal(len(urls), 1)
# assert_equal(len(urls), 1)

url = urls[0]
# url = urls[0]

assert_is_not_none(url)
assert_equal(url.split(':')[0], 'https')
# assert_is_not_none(url)
# assert_equal(url.split(':')[0], 'https')

@song_test
def wc_upload_album_art(self):
url = self.wc.upload_album_art(self.user_songs[0].sid, test_utils.image_filename)
assert_equal(url[:4], 'http')
# TODO download the track and verify the metadata changed
# @song_test
# def wc_upload_album_art(self):
# url = self.wc.upload_album_art(self.user_songs[0].sid, test_utils.image_filename)
# assert_equal(url[:4], 'http')
# # TODO download the track and verify the metadata changed

# ---------
# MC tests
Expand Down

0 comments on commit 5b939e2

Please sign in to comment.