@@ -373,7 +373,9 @@ def test_share_thumbnail(self):
373373
374374 shot_url = urlparse .urlparse (response_shot_thumbnail .get ('image' ))
375375 version_url = urlparse .urlparse (response_version_thumbnail .get ('image' ))
376- self .assertEqual (shot_url .path , version_url .path )
376+ shot_path = _get_path (shot_url )
377+ version_path = _get_path (version_url )
378+ self .assertEqual (shot_path , version_path )
377379
378380 # share thumbnail from source entity with entities
379381 source_thumbnail_id = self .sg .upload_thumbnail ("Version" ,
@@ -401,8 +403,12 @@ def test_share_thumbnail(self):
401403 version_url = urlparse .urlparse (response_version_thumbnail .get ('image' ))
402404 asset_url = urlparse .urlparse (response_asset_thumbnail .get ('image' ))
403405
404- self .assertEqual (version_url .path , shot_url .path )
405- self .assertEqual (version_url .path , asset_url .path )
406+ shot_path = _get_path (shot_url )
407+ version_path = _get_path (version_url )
408+ asset_path = _get_path (asset_url )
409+
410+ self .assertEqual (version_path , shot_path )
411+ self .assertEqual (version_path , asset_path )
406412
407413 # raise errors when missing required params or providing conflicting ones
408414 self .assertRaises (shotgun_api3 .ShotgunError , self .sg .share_thumbnail ,
@@ -1422,6 +1428,14 @@ def _has_unicode(data):
14221428 return True
14231429 return False
14241430
1431+ def _get_path (url ):
1432+ # url_parse returns native objects for older python versions (2.4)
1433+ if isinstance (url , dict ):
1434+ return url .get ('path' )
1435+ elif isinstance (url , tuple ):
1436+ return os .path .join (url [:4 ])
1437+ else :
1438+ return url .path
14251439
14261440if __name__ == '__main__' :
14271441 unittest .main ()
0 commit comments