Skip to content

Commit 158875f

Browse files
1 parent 9394b79 commit 158875f

File tree

2 files changed

+14
-40
lines changed

2 files changed

+14
-40
lines changed

tests/system/test__signing.py

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ def _create_signed_list_blobs_url_helper(
5959
:Response headers end."
6060

6161

62-
def test_create_signed_list_blobs_url_v2(
63-
storage_client, signing_bucket, no_mtls
64-
):
62+
def test_create_signed_list_blobs_url_v2(storage_client, signing_bucket, no_mtls):
6563
_create_signed_list_blobs_url_helper(
6664
storage_client,
6765
signing_bucket,
@@ -83,9 +81,7 @@ def test_create_signed_list_blobs_url_v2_w_expiration(
8381
)
8482

8583

86-
def test_create_signed_list_blobs_url_v4(
87-
storage_client, signing_bucket, no_mtls
88-
):
84+
def test_create_signed_list_blobs_url_v4(storage_client, signing_bucket, no_mtls):
8985
_create_signed_list_blobs_url_helper(
9086
storage_client,
9187
signing_bucket,
@@ -229,9 +225,7 @@ def test_create_signed_read_url_v4_w_non_ascii_name(
229225
)
230226

231227

232-
def test_create_signed_read_url_v2_w_csek(
233-
storage_client, signing_bucket, no_mtls
234-
):
228+
def test_create_signed_read_url_v2_w_csek(storage_client, signing_bucket, no_mtls):
235229
encryption_key = os.urandom(32)
236230
_create_signed_read_url_helper(
237231
storage_client,
@@ -242,9 +236,7 @@ def test_create_signed_read_url_v2_w_csek(
242236
)
243237

244238

245-
def test_create_signed_read_url_v4_w_csek(
246-
storage_client, signing_bucket, no_mtls
247-
):
239+
def test_create_signed_read_url_v4_w_csek(storage_client, signing_bucket, no_mtls):
248240
encryption_key = os.urandom(32)
249241
_create_signed_read_url_helper(
250242
storage_client,
@@ -327,9 +319,7 @@ def test_create_signed_read_url_v4_w_access_token_universe_domain(
327319
"https://www.googleapis.com/auth/devstorage.read_write",
328320
"https://www.googleapis.com/auth/iam",
329321
]
330-
response = universe_domain_iam_client.generate_access_token(
331-
name=name, scope=scope
332-
)
322+
response = universe_domain_iam_client.generate_access_token(name=name, scope=scope)
333323

334324
_create_signed_read_url_helper(
335325
universe_domain_client,
@@ -340,9 +330,7 @@ def test_create_signed_read_url_v4_w_access_token_universe_domain(
340330
)
341331

342332

343-
def _create_signed_delete_url_helper(
344-
client, bucket, version="v2", expiration=None
345-
):
333+
def _create_signed_delete_url_helper(client, bucket, version="v2", expiration=None):
346334
expiration = _morph_expiration(version, expiration)
347335

348336
blob = bucket.blob("DELETE_ME.txt")
@@ -372,9 +360,7 @@ def test_create_signed_delete_url_v2(storage_client, signing_bucket, no_mtls):
372360

373361

374362
def test_create_signed_delete_url_v4(storage_client, signing_bucket, no_mtls):
375-
_create_signed_delete_url_helper(
376-
storage_client, signing_bucket, version="v4"
377-
)
363+
_create_signed_delete_url_helper(storage_client, signing_bucket, version="v4")
378364

379365

380366
def _create_signed_resumable_upload_url_helper(
@@ -393,9 +379,7 @@ def _create_signed_resumable_upload_url_helper(
393379
)
394380

395381
post_headers = {"x-goog-resumable": "start"}
396-
post_response = requests.post(
397-
signed_resumable_upload_url, headers=post_headers
398-
)
382+
post_response = requests.post(signed_resumable_upload_url, headers=post_headers)
399383
assert (
400384
post_response.status_code == 201
401385
), f"Response content start: {post_response.content} \
@@ -445,19 +429,15 @@ def _create_signed_resumable_upload_url_helper(
445429
:Response headers end."
446430

447431

448-
def test_create_signed_resumable_upload_url_v2(
449-
storage_client, signing_bucket, no_mtls
450-
):
432+
def test_create_signed_resumable_upload_url_v2(storage_client, signing_bucket, no_mtls):
451433
_create_signed_resumable_upload_url_helper(
452434
storage_client,
453435
signing_bucket,
454436
version="v2",
455437
)
456438

457439

458-
def test_create_signed_resumable_upload_url_v4(
459-
storage_client, signing_bucket, no_mtls
460-
):
440+
def test_create_signed_resumable_upload_url_v4(storage_client, signing_bucket, no_mtls):
461441
_create_signed_resumable_upload_url_helper(
462442
storage_client,
463443
signing_bucket,
@@ -494,9 +474,7 @@ def test_generate_signed_post_policy_v4(
494474
)
495475
with open(blob_name, "r") as f:
496476
files = {"file": (blob_name, f)}
497-
response = requests.post(
498-
policy["url"], data=policy["fields"], files=files
499-
)
477+
response = requests.post(policy["url"], data=policy["fields"], files=files)
500478

501479
os.remove(blob_name)
502480
assert (
@@ -549,9 +527,7 @@ def test_generate_signed_post_policy_v4_access_token_sa_email(
549527
)
550528
with open(blob_name, "r") as f:
551529
files = {"file": (blob_name, f)}
552-
response = requests.post(
553-
policy["url"], data=policy["fields"], files=files
554-
)
530+
response = requests.post(policy["url"], data=policy["fields"], files=files)
555531

556532
os.remove(blob_name)
557533
assert (
@@ -591,9 +567,7 @@ def test_generate_signed_post_policy_v4_invalid_field(
591567
)
592568
with open(blob_name, "r") as f:
593569
files = {"file": (blob_name, f)}
594-
response = requests.post(
595-
policy["url"], data=policy["fields"], files=files
596-
)
570+
response = requests.post(policy["url"], data=policy["fields"], files=files)
597571

598572
os.remove(blob_name)
599573
assert (

tests/system/test_bucket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,7 @@ def test_bucket_ip_filter_patch(storage_client, buckets_to_delete):
13381338
]
13391339
assert len(reloaded_filter.vpc_network_sources) == 1
13401340

1341+
13411342
def test_list_buckets_with_ip_filter(storage_client, buckets_to_delete):
13421343
"""Test that listing buckets returns a summarized IP filter."""
13431344
bucket_name = _helpers.unique_name("ip-filter-list")
@@ -1366,4 +1367,3 @@ def test_list_buckets_with_ip_filter(storage_client, buckets_to_delete):
13661367
# Check that the summarized filter does not include full details.
13671368
assert summarized_filter.public_network_source is None
13681369
assert summarized_filter.vpc_network_sources == []
1369-

0 commit comments

Comments
 (0)