@@ -120,11 +120,14 @@ async def test_returns_ok_without_proxy(self, faker: faker.Faker) -> None:
120120
121121 assert file_url == presigned_url
122122
123- async def test_returns_ok_with_proxy (self , faker : faker .Faker ) -> None :
124- endpoint_url , proxy_base_url = "http://s3" , "https://s3-proxy.me.com"
123+ @pytest .mark .parametrize ("endpoint_url" , ["http://s3" , "http://s3/" ])
124+ @pytest .mark .parametrize ("proxy_base_url" , ["https://s3-proxy.me.com" , "https://s3-proxy.me.com/" ])
125+ async def test_returns_ok_with_proxy (self , faker : faker .Faker , endpoint_url : str , proxy_base_url : str ) -> None :
125126 presigned_url_path : typing .Final = faker .pystr ()
126127 s3_client_mock : typing .Final = mock .Mock (
127- generate_presigned_url = mock .AsyncMock (return_value = f"{ endpoint_url } /{ presigned_url_path } " ),
128+ generate_presigned_url = mock .AsyncMock (
129+ return_value = f"{ endpoint_url .removesuffix ('/' )} /{ presigned_url_path } "
130+ ),
128131 meta = mock .Mock (endpoint_url = endpoint_url ),
129132 )
130133
@@ -135,7 +138,7 @@ async def test_returns_ok_with_proxy(self, faker: faker.Faker) -> None:
135138 proxy_base_url = proxy_base_url ,
136139 )
137140
138- assert file_url == f"{ proxy_base_url } /{ presigned_url_path } "
141+ assert file_url == f"{ proxy_base_url . removesuffix ( '/' ) } /{ presigned_url_path } "
139142
140143 async def test_fails_with_proxy (self , faker : faker .Faker ) -> None :
141144 presigned_url_path : typing .Final = faker .pystr ()
0 commit comments