diff --git a/Tests/TestsHelper.py b/Tests/TestsHelper.py index 9521a61..a44326f 100644 --- a/Tests/TestsHelper.py +++ b/Tests/TestsHelper.py @@ -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' diff --git a/Tests/VSpotifyTests.py b/Tests/VSpotifyTests.py new file mode 100644 index 0000000..cd58cb3 --- /dev/null +++ b/Tests/VSpotifyTests.py @@ -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 diff --git a/run_tests.py b/run_tests.py index 430eeb5..03417ba 100644 --- a/run_tests.py +++ b/run_tests.py @@ -1,5 +1,8 @@ from Tests.VDownloaderTests import VulkanDownloaderTest +from Tests.VSpotifyTests import VulkanSpotifyTest tester = VulkanDownloaderTest() +# tester.run() +tester = VulkanSpotifyTest() tester.run()