2525from google .cloud import iam_credentials_v1
2626from . import _helpers
2727
28+ API_ACCESS_ENDPOINT = os .getenv (
29+ "API_ENDPOINT_OVERRIDE" , "https://storage.googleapis.com"
30+ )
31+
2832
2933def _morph_expiration (version , expiration ):
3034 if expiration is not None :
@@ -42,17 +46,17 @@ def _create_signed_list_blobs_url_helper(
4246 expiration = _morph_expiration (version , expiration )
4347
4448 signed_url = bucket .generate_signed_url (
45- expiration = expiration , method = method , client = client , version = version
49+ expiration = expiration ,
50+ method = method ,
51+ client = client ,
52+ version = version ,
53+ api_access_endpoint = API_ACCESS_ENDPOINT ,
4654 )
4755
4856 response = requests .get (signed_url )
4957 assert response .status_code == 200
5058
5159
52- @pytest .mark .skipif (
53- "API_ENDPOINT_OVERRIDE" in os .environ ,
54- reason = "Failing test for the overriding endpoint" ,
55- )
5660def test_create_signed_list_blobs_url_v2 (storage_client , signing_bucket , no_mtls ):
5761 _create_signed_list_blobs_url_helper (
5862 storage_client ,
@@ -61,10 +65,6 @@ def test_create_signed_list_blobs_url_v2(storage_client, signing_bucket, no_mtls
6165 )
6266
6367
64- @pytest .mark .skipif (
65- "API_ENDPOINT_OVERRIDE" in os .environ ,
66- reason = "Failing test for the overriding endpoint" ,
67- )
6868def test_create_signed_list_blobs_url_v2_w_expiration (
6969 storage_client , signing_bucket , no_mtls
7070):
@@ -79,10 +79,6 @@ def test_create_signed_list_blobs_url_v2_w_expiration(
7979 )
8080
8181
82- @pytest .mark .skipif (
83- "API_ENDPOINT_OVERRIDE" in os .environ ,
84- reason = "Failing test for the overriding endpoint" ,
85- )
8682def test_create_signed_list_blobs_url_v4 (storage_client , signing_bucket , no_mtls ):
8783 _create_signed_list_blobs_url_helper (
8884 storage_client ,
@@ -91,10 +87,6 @@ def test_create_signed_list_blobs_url_v4(storage_client, signing_bucket, no_mtls
9187 )
9288
9389
94- @pytest .mark .skipif (
95- "API_ENDPOINT_OVERRIDE" in os .environ ,
96- reason = "Failing test for the overriding endpoint" ,
97- )
9890def test_create_signed_list_blobs_url_v4_w_expiration (
9991 storage_client , signing_bucket , no_mtls
10092):
0 commit comments