File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
embed_video/tests/backends Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11from unittest import TestCase
22from unittest .mock import patch
3+ import urllib .parse
34
45import requests
56
@@ -39,9 +40,17 @@ def test_vimeo_get_info_exception(self):
3940
4041 def test_get_thumbnail_url (self ):
4142 backend = VimeoBackend ("https://vimeo.com/72304002" )
43+ expected_url = "https://i.vimeocdn.com/video/446150690-9621b882540b53788eaa36ef8e303d4e06fc40af3d27918b7f561bb44ed971dc-d_640"
44+ actual_url = backend .get_thumbnail_url ()
45+
46+ # Parse URLs and compare without query parameters
47+ expected_parts = urllib .parse .urlparse (expected_url )
48+ actual_parts = urllib .parse .urlparse (actual_url )
49+
50+ # Compare scheme, netloc, and path only
4251 self .assertEqual (
43- backend . get_thumbnail_url ( ),
44- "https://i.vimeocdn.com/video/446150690-9621b882540b53788eaa36ef8e303d4e06fc40af3d27918b7f561bb44ed971dc-d_640?region=us" ,
52+ ( expected_parts . scheme , expected_parts . netloc , expected_parts . path ),
53+ ( actual_parts . scheme , actual_parts . netloc , actual_parts . path )
4554 )
4655
4756 @patch ("embed_video.backends.EMBED_VIDEO_TIMEOUT" , 0.000001 )
You can’t perform that action at this time.
0 commit comments