Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_download_from_list_without_youtube_api(
self, metadata_fixture, content_fixture
):
const.args.youtube_api_key = None
youtube_tools.set_api_key()
content_fixture = youtube_tools.go_pafy(TRACK_SEARCH, metadata_fixture)
title = youtube_tools.get_youtube_title(content_fixture, 1)
assert title == "1. {0}".format(EXPECTED_TITLE)
def test_default(self):
const.args.youtube_api_key = None
youtube_tools.set_api_key()
key = youtube_tools.pafy.g.api_key
assert key == EXPECTED_YT_API_KEY
def test_youtube_title():
global content
content = youtube_tools.go_pafy(TRACK_URL, meta_tags)
title = youtube_tools.get_youtube_title(content)
assert title == EXPECTED_YT_TITLE
def test_download_from_list_without_youtube_api(
self, metadata_fixture, content_fixture
):
const.args.youtube_api_key = None
youtube_tools.set_api_key()
content_fixture = youtube_tools.go_pafy(TRACK_SEARCH, metadata_fixture)
title = youtube_tools.get_youtube_title(content_fixture, 1)
assert title == "1. {0}".format(EXPECTED_TITLE)
def __init__(self, raw_song, number=None):
self.raw_song = raw_song
self.number = number
self.content, self.meta_tags = youtube_tools.match_video_and_metadata(raw_song)
self.total_songs = int(self.meta_tags["total_tracks"])