Adding Spotify Tests

This commit is contained in:
Rafael Vargas 2022-07-10 13:47:08 -03:00
parent 0938dd37e2
commit 8336a95eda
3 changed files with 73 additions and 1 deletions

View File

@ -5,10 +5,17 @@ class TestsConstants(Singleton):
def __init__(self) -> None:
if not super().created:
self.EMPTY_STRING_ERROR_MSG = 'Downloader with Empty String should be empty list.'
self.SPOTIFY_TRACK_URL = 'https://open.spotify.com/track/7wpnz7hje4FbnjZuWQtJHP'
self.MUSIC_TITLE_STRING = 'Experience || AMV || Anime Mix'
self.YT_MUSIC_URL = 'https://www.youtube.com/watch?v=MvJoiv842mk'
self.YT_MIX_URL = 'https://www.youtube.com/watch?v=ePjtnSPFWK8&list=RDMMePjtnSPFWK8&start_radio=1'
self.YT_PERSONAL_PLAYLIST_URL = 'https://www.youtube.com/playlist?list=PLbbKJHHZR9ShYuKAr71cLJCFbYE-83vhS'
# Links from playlists in channels some times must be extracted with force by Downloader
self.YT_CHANNEL_PLAYLIST_URL = 'https://www.youtube.com/watch?v=MvJoiv842mk&list=PLAI1099Tvk0zWU8X4dwc4vv4MpePQ4DLl'
self.SPOTIFY_TRACK_URL = 'https://open.spotify.com/track/7wpnz7hje4FbnjZuWQtJHP'
self.SPOTIFY_PLAYLIST_URL = 'https://open.spotify.com/playlist/37i9dQZF1EIV9u4LtkBkSF'
self.SPOTIFY_ARTIST_URL = 'https://open.spotify.com/artist/4HF14RSTZQcEafvfPCFEpI'
self.SPOTIFY_ALBUM_URL = 'https://open.spotify.com/album/71O60S5gIJSIAhdnrDIh3N'
self.SPOTIFY_WRONG1_URL = 'https://open.spotify.com/wrongUrl'
self.SPOTIFY_WRONG2_URL = 'https://open.spotify.com/track/WrongID'

62
Tests/VSpotifyTests.py Normal file
View File

@ -0,0 +1,62 @@
from Tests.TestBase import VulkanTesterBase
class VulkanSpotifyTest(VulkanTesterBase):
def __init__(self) -> None:
super().__init__()
def test_spotifyTrack(self) -> bool:
musics = self._runner.run_coroutine(
self._searcher.search(self._constants.SPOTIFY_TRACK_URL))
if len(musics) > 0:
return True
else:
return False
def test_spotifyPlaylist(self) -> bool:
musics = self._runner.run_coroutine(
self._searcher.search(self._constants.SPOTIFY_PLAYLIST_URL))
if len(musics) > 0:
return True
else:
return False
def test_spotifyArtist(self) -> bool:
musics = self._runner.run_coroutine(
self._searcher.search(self._constants.SPOTIFY_ARTIST_URL))
if len(musics) > 0:
return True
else:
return False
def test_spotifyAlbum(self) -> bool:
musics = self._runner.run_coroutine(
self._searcher.search(self._constants.SPOTIFY_ARTIST_URL))
if len(musics) > 0:
return True
else:
return False
def test_spotifyWrongUrlOne(self) -> bool:
musics = self._runner.run_coroutine(
self._searcher.search(self._constants.SPOTIFY_WRONG1_URL))
print(musics)
if len(musics) == 0:
return True
else:
return False
def test_spotifyWrongUrlTwo(self) -> bool:
musics = self._runner.run_coroutine(
self._searcher.search(self._constants.SPOTIFY_WRONG2_URL))
print(musics)
if len(musics) == 0:
return True
else:
return False

View File

@ -1,5 +1,8 @@
from Tests.VDownloaderTests import VulkanDownloaderTest
from Tests.VSpotifyTests import VulkanSpotifyTest
tester = VulkanDownloaderTest()
# tester.run()
tester = VulkanSpotifyTest()
tester.run()