mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Fix tests
This commit is contained in:
@@ -10,14 +10,14 @@ for x in os.listdir(spotdl.args.folder):
|
||||
|
||||
def test_youtube_url():
|
||||
expect_url = 'youtube.com/watch?v=qOOcy2-tmbk'
|
||||
url = spotdl.generate_youtube_url(raw_song)
|
||||
url = spotdl.generate_youtube_url(raw_song, meta_tags=None)
|
||||
assert url == expect_url
|
||||
|
||||
|
||||
def test_youtube_title():
|
||||
expect_title = "Tony's Videos VERY SHORT VIDEO 28.10.2016"
|
||||
global content
|
||||
content = spotdl.go_pafy(raw_song)
|
||||
content = spotdl.go_pafy(raw_song, meta_tags=None)
|
||||
global title
|
||||
title = spotdl.get_youtube_title(content)
|
||||
assert title == expect_title
|
||||
@@ -26,7 +26,7 @@ def test_check_exists():
|
||||
expect_check = False
|
||||
# prerequisites for determining filename
|
||||
file_name = spotdl.misc.sanitize_title(title)
|
||||
check = spotdl.check_exists(file_name, raw_song, islist=True)
|
||||
check = spotdl.check_exists(file_name, raw_song, meta_tags=None, islist=True)
|
||||
assert check == expect_check
|
||||
|
||||
|
||||
@@ -68,5 +68,5 @@ def test_check_exists2():
|
||||
file_name = spotdl.misc.sanitize_title(title)
|
||||
input_song = file_name + spotdl.args.input_ext
|
||||
os.remove(os.path.join(spotdl.args.folder, input_song))
|
||||
check = spotdl.check_exists(file_name, raw_song, islist=True)
|
||||
check = spotdl.check_exists(file_name, raw_song, meta_tags=None, islist=True)
|
||||
assert check == expect_check
|
||||
|
||||
@@ -19,13 +19,13 @@ def test_spotify_title():
|
||||
|
||||
def youtube_url():
|
||||
expect_url = 'youtube.com/watch?v=rg1wfcty0BA'
|
||||
url = spotdl.generate_youtube_url(raw_song)
|
||||
url = spotdl.generate_youtube_url(raw_song, meta_tags)
|
||||
assert url == expect_url
|
||||
|
||||
|
||||
def youtube_title():
|
||||
expect_title = 'Intro - David André Østby'
|
||||
content = spotdl.go_pafy(raw_song)
|
||||
content = spotdl.go_pafy(raw_song, meta_tags)
|
||||
title = spotdl.get_youtube_title(content)
|
||||
assert title == expect_title
|
||||
|
||||
@@ -36,14 +36,14 @@ def test_check_exists():
|
||||
songname = spotdl.generate_songname(meta_tags)
|
||||
global file_name
|
||||
file_name = spotdl.misc.sanitize_title(songname)
|
||||
check = spotdl.check_exists(file_name, raw_song, islist=True)
|
||||
check = spotdl.check_exists(file_name, raw_song, meta_tags, islist=True)
|
||||
assert check == expect_check
|
||||
|
||||
|
||||
def test_download():
|
||||
expect_download = True
|
||||
# prerequisites for determining filename
|
||||
content = spotdl.go_pafy(raw_song)
|
||||
content = spotdl.go_pafy(raw_song, meta_tags)
|
||||
download = spotdl.download_song(file_name, content)
|
||||
assert download == expect_download
|
||||
|
||||
@@ -73,5 +73,5 @@ def test_check_exists2():
|
||||
# prerequisites for determining filename
|
||||
input_song = file_name + spotdl.args.input_ext
|
||||
os.remove(os.path.join(spotdl.args.folder, input_song))
|
||||
check = spotdl.check_exists(file_name, raw_song, islist=True)
|
||||
check = spotdl.check_exists(file_name, raw_song, meta_tags, islist=True)
|
||||
assert check == expect_check
|
||||
|
||||
Reference in New Issue
Block a user