Skip to content

Commit b092699

Browse files
authored
Merge pull request #4 from rsaksham-dev/main_pr_2
Main pr 2
2 parents 2e0708c + 6c66e31 commit b092699

3 files changed

Lines changed: 17 additions & 22 deletions

File tree

.kokoro/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export API_ENDPOINT_OVERRIDE
3939
# Export variable to override api endpoint version
4040
export API_VERSION_OVERRIDE
4141

42+
# Export dual region locations
43+
export DUAL_REGION_LOC_1
44+
export DUAL_REGION_LOC_2
45+
4246
# Remove old nox
4347
python3 -m pip uninstall --yes --quiet nox-automation
4448

tests/system/test__signing.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
from google.cloud import iam_credentials_v1
2626
from . import _helpers
2727

28+
API_ACCESS_ENDPOINT = os.getenv(
29+
"API_ENDPOINT_OVERRIDE", "https://storage.googleapis.com"
30+
)
31+
2832

2933
def _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-
)
5660
def 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-
)
6868
def 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-
)
8682
def 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-
)
9890
def test_create_signed_list_blobs_url_v4_w_expiration(
9991
storage_client, signing_bucket, no_mtls
10092
):

tests/system/test_client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,15 @@ def test_create_bucket_simple(storage_client, buckets_to_delete):
7373
assert created.name == new_bucket_name
7474

7575

76-
@pytest.mark.skipif(
77-
"API_ENDPOINT_OVERRIDE" in os.environ,
78-
reason="Failing test for the overriding endpoint",
79-
)
8076
def test_create_bucket_dual_region(storage_client, buckets_to_delete):
8177
from google.cloud.storage.constants import DUAL_REGION_LOCATION_TYPE
8278

8379
new_bucket_name = _helpers.unique_name("dual-region-bucket")
8480
location = "US"
85-
data_locations = ["US-EAST1", "US-WEST1"]
81+
dual_data_loc_1 = os.getenv("DUAL_REGION_LOC_1", "US-EAST1")
82+
dual_data_loc_2 = os.getenv("DUAL_REGION_LOC_2", "US-WEST1")
83+
84+
data_locations = [dual_data_loc_1, dual_data_loc_2]
8685

8786
with pytest.raises(exceptions.NotFound):
8887
storage_client.get_bucket(new_bucket_name)

0 commit comments

Comments
 (0)