mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Fix tests and monkeypatch Pafy.download method for version on GitHub
This commit is contained in:
@@ -39,7 +39,7 @@ def metadata_fixture():
|
||||
|
||||
|
||||
def test_metadata(metadata_fixture):
|
||||
expect_number = 23
|
||||
expect_number = 24
|
||||
assert len(metadata_fixture) == expect_number
|
||||
|
||||
|
||||
@@ -107,22 +107,16 @@ class TestDownload:
|
||||
|
||||
def test_m4a(self, monkeypatch, filename_fixture):
|
||||
expect_download = True
|
||||
monkeypatch.setattr(
|
||||
"pafy.backend_shared.BaseStream.download", self.blank_audio_generator
|
||||
)
|
||||
download = youtube_tools.download_song(
|
||||
filename_fixture + ".m4a", pytest.content_fixture
|
||||
)
|
||||
monkeypatch.setattr("pafy.backend_shared.BaseStream.download", self.blank_audio_generator)
|
||||
monkeypatch.setattr("pafy.backend_youtube_dl.YtdlStream.download", self.blank_audio_generator)
|
||||
download = youtube_tools.download_song(filename_fixture + ".m4a", pytest.content_fixture)
|
||||
assert download == expect_download
|
||||
|
||||
def test_webm(self, monkeypatch, filename_fixture):
|
||||
expect_download = True
|
||||
monkeypatch.setattr(
|
||||
"pafy.backend_shared.BaseStream.download", self.blank_audio_generator
|
||||
)
|
||||
download = youtube_tools.download_song(
|
||||
filename_fixture + ".webm", pytest.content_fixture
|
||||
)
|
||||
monkeypatch.setattr("pafy.backend_shared.BaseStream.download", self.blank_audio_generator)
|
||||
monkeypatch.setattr("pafy.backend_youtube_dl.YtdlStream.download", self.blank_audio_generator)
|
||||
download = youtube_tools.download_song(filename_fixture + ".webm", pytest.content_fixture)
|
||||
assert download == expect_download
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class TestGenerateMetadata:
|
||||
return metadata
|
||||
|
||||
def test_len(self, metadata_fixture):
|
||||
assert len(metadata_fixture) == 23
|
||||
assert len(metadata_fixture) == 24
|
||||
|
||||
def test_trackname(self, metadata_fixture):
|
||||
assert metadata_fixture["name"] == "Spectre"
|
||||
|
||||
Reference in New Issue
Block a user