Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 9c84456

Browse files
samples: add samples for bucket encryption enforcement config
Co-authored-by: nidhiii-27 <224584462+nidhiii-27@users.noreply.github.com>
1 parent 9e0c411 commit 9c84456

6 files changed

Lines changed: 3 additions & 76 deletions

fix_test.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

samples/snippets/encryption_test.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import storage_get_bucket_encryption_enforcement_config
3131
import storage_set_bucket_encryption_enforcement_config
3232
import storage_update_encryption_enforcement_config
33-
import storage_remove_all_bucket_encryption_enforcement_config
3433

3534
BUCKET = os.environ["CLOUD_STORAGE_BUCKET"]
3635
KMS_KEY = os.environ["MAIN_CLOUD_KMS_KEY"]
@@ -161,18 +160,6 @@ def test_bucket_encryption_enforcement_config(capsys):
161160
assert "Customer-supplied encryption enforcement config restriction mode: None" in out
162161
assert "Google-managed encryption enforcement config restriction mode: FULLY_RESTRICTED" in out
163162

164-
# Remove
165-
storage_remove_all_bucket_encryption_enforcement_config.remove_all_bucket_encryption_enforcement_config(bucket_name)
166-
out, _ = capsys.readouterr()
167-
assert f"Removed Encryption Enforcement Config from bucket {bucket_name}." in out
168-
169-
# Get after remove
170-
storage_get_bucket_encryption_enforcement_config.get_bucket_encryption_enforcement_config(bucket_name)
171-
out, _ = capsys.readouterr()
172-
assert "Customer-managed encryption enforcement config restriction mode: None" in out
173-
assert "Customer-supplied encryption enforcement config restriction mode: None" in out
174-
assert "Google-managed encryption enforcement config restriction mode: None" in out
175-
176163
finally:
177164
try:
178165
storage.Client().get_bucket(bucket_name).delete(force=True)

samples/snippets/storage_get_bucket_encryption_enforcement_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2026 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

samples/snippets/storage_remove_all_bucket_encryption_enforcement_config.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

samples/snippets/storage_set_bucket_encryption_enforcement_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2026 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

samples/snippets/storage_update_encryption_enforcement_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2026 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)