Skip to content

Commit

Permalink
fix: bad tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dysta committed Aug 7, 2024
1 parent 0ea6326 commit 47167a7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
26 changes: 15 additions & 11 deletions tests/test_music_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ async def test_music_request_success_youtube_live_url(self):

async def test_music_request_success_soundcloud_url(self):
with disable_logging():
async with MusicRequest("https://soundcloud.com/gee_baller/playboi-carti-cult-classic") as req:
async with MusicRequest(
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb"
) as req:
await req.execute()

self.assertTrue(req.success)
Expand All @@ -53,13 +55,13 @@ async def test_music_request_success_soundcloud_url(self):

result: dict = req.result

self.assertEqual(result.get("title"), "Playboi Carti – Cult Classic")
self.assertEqual(result.get("uploader"), "Gee Baller")
self.assertEqual(result.get("title"), "Skychaser - 104.5 Sky FM (2nd Part, Slowed And Reverb)")
self.assertEqual(result.get("uploader"), "[wstd7331]")
self.assertEqual(
result.get("webpage_url"),
"https://soundcloud.com/gee_baller/playboi-carti-cult-classic",
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb",
)
self.assertEqual(round(result.get("duration")), 118)
self.assertEqual(round(result.get("duration")), 201)
self.assertIsNone(result.get("thumbnail"))

async def test_music_request_playlist_youtube_url(self):
Expand Down Expand Up @@ -286,7 +288,9 @@ async def test_music_request_youtube_query_convert_to_result(self):

async def test_music_request_success_soundcloud_url_convert_to_result(self):
with disable_logging():
async with MusicRequest("https://soundcloud.com/gee_baller/playboi-carti-cult-classic") as req:
async with MusicRequest(
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb"
) as req:
await req.execute()

self.assertTrue(req.success)
Expand All @@ -295,14 +299,14 @@ async def test_music_request_success_soundcloud_url_convert_to_result(self):

result: Result = Result(req.result)

self.assertEqual(result.title, "Playboi Carti – Cult Classic")
self.assertEqual(result.channel, "Gee Baller")
self.assertEqual(result.title, "Skychaser - 104.5 Sky FM (2nd Part, Slowed And Reverb)")
self.assertEqual(result.channel, "[wstd7331]")
self.assertEqual(
result.web_url,
"https://soundcloud.com/gee_baller/playboi-carti-cult-classic",
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb",
)
self.assertEqual(result.duration, 118)
self.assertEqual(result.fmt_duration, "1:58")
self.assertEqual(result.duration, 201)
self.assertEqual(result.fmt_duration, "3:21")
self.assertFalse(result.live)
self.assertIsNone(result.requester)

Expand Down
26 changes: 15 additions & 11 deletions tests/test_stream_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ async def test_stream_request_success_youtube(self):

async def test_stream_request_success_soundcloud(self):
with disable_logging():
async with StreamRequest("https://soundcloud.com/gee_baller/playboi-carti-cult-classic") as req:
async with StreamRequest(
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb"
) as req:
await req.execute()

self.assertTrue(req.success)
Expand All @@ -38,13 +40,13 @@ async def test_stream_request_success_soundcloud(self):

result: dict = req.result

self.assertEqual(result.get("title"), "Playboi Carti – Cult Classic")
self.assertEqual(result.get("uploader"), "Gee Baller")
self.assertEqual(result.get("title"), "Skychaser - 104.5 Sky FM (2nd Part, Slowed And Reverb)")
self.assertEqual(result.get("uploader"), "[wstd7331]")
self.assertEqual(
result.get("webpage_url"),
"https://soundcloud.com/gee_baller/playboi-carti-cult-classic",
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb",
)
self.assertEqual(round(result.get("duration")), 118)
self.assertEqual(round(result.get("duration")), 201)

self.assertIsNotNone(result.get("thumbnail", None))
self.assertIsNotNone(result.get("url", None))
Expand Down Expand Up @@ -118,7 +120,9 @@ async def test_stream_request_success_youtube_live_convert_to_song(self):

async def test_stream_request_success_soundcloud_convert_to_song(self):
with disable_logging():
async with StreamRequest("https://soundcloud.com/gee_baller/playboi-carti-cult-classic") as req:
async with StreamRequest(
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb"
) as req:
await req.execute()

self.assertTrue(req.success)
Expand All @@ -127,14 +131,14 @@ async def test_stream_request_success_soundcloud_convert_to_song(self):

result: Song = Song(req.result)

self.assertEqual(result.title, "Playboi Carti – Cult Classic")
self.assertEqual(result.channel, "Gee Baller")
self.assertEqual(result.title, "Skychaser - 104.5 Sky FM (2nd Part, Slowed And Reverb)")
self.assertEqual(result.channel, "[wstd7331]")
self.assertEqual(
result.web_url,
"https://soundcloud.com/gee_baller/playboi-carti-cult-classic",
"https://soundcloud.com/wstd7331/skychaser-1045-sky-fm-2nd-part-slowed-and-reverb",
)
self.assertEqual(result.duration, 118)
self.assertEqual(result.fmt_duration, "1:58")
self.assertEqual(result.duration, 201)
self.assertEqual(result.fmt_duration, "3:21")

self.assertIsNotNone(result.thumbnail)
self.assertIsNotNone(result.stream_url)

0 comments on commit 47167a7

Please sign in to comment.