Switch to shorter song to lower test duration

This commit is contained in:
Ritiek
2017-06-25 14:15:39 +05:30
parent 532bd892b0
commit 2b0a3cc909

View File

@@ -2,20 +2,20 @@
import spotdl
raw_song = 'http://open.spotify.com/track/2e0jnySVkYF1pvBlpoNX1Y'
raw_song = 'http://open.spotify.com/track/0JlS7BXXD07hRmevDnbPDU'
def test_spotify_title():
expect_title = 'David André Østby - Tilbake (SAEVIK Remix)'
expect_title = 'David André Østby - Intro'
title = spotdl.generate_songname(raw_song)
assert title == expect_title
def test_youtube_url():
expect_url = 'youtube.com/watch?v=zkD4smbefbc'
expect_url = 'youtube.com/watch?v=rg1wfcty0BA'
url = spotdl.generate_youtube_url(raw_song)
assert url == expect_url
def test_youtube_title():
expect_title = 'Tilbake (SAEVIK Remix) [Feat. Marie Hognestad] - David André Østby'
expect_title = 'Intro - David André Østby'
content = spotdl.go_pafy(raw_song)
title = spotdl.get_youtube_title(content)
assert title == expect_title
@@ -51,7 +51,19 @@ def test_metadata():
music_file = spotdl.misc.generate_filename(content.title)
music_file = spotdl.misc.fix_decoding(music_file)
meta_tags = spotdl.generate_metadata(raw_song)
output_song = music_file + spotdl.args.output_ext
spotdl.metadata.embed(output_song, meta_tags)
metadata = spotdl.check_exists(music_file, raw_song)
assert metadata == expect_metadata
metadata_output = spotdl.metadata.embed(output_song, meta_tags)
input_song = music_file + spotdl.args.input_ext
metadata_input = spotdl.metadata.embed(input_song, meta_tags)
assert metadata_output == (metadata_input == expect_metadata)
def check_exists2():
expect_check = True
content = spotdl.go_pafy(raw_song)
music_file = spotdl.misc.generate_filename(content.title)
music_file = spotdl.misc.fix_decoding(music_file)
check = spotdl.check_exists(music_file, raw_song)
assert check == expect_check