From a66e3dbcec77ea2ee7d06efec798dbe8f811ecbf Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Fri, 10 Jan 2020 13:02:29 +0000 Subject: [PATCH] Fix VERSION fixtures in several tests A recent change to iam objects in API core started causing an error if accessing those objects as dicts, if their version is > 1. This commit addresses that by setting the VERSION to 1 in fixtures. --- storage/tests/unit/test_blob.py | 8 ++++---- storage/tests/unit/test_bucket.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/storage/tests/unit/test_blob.py b/storage/tests/unit/test_blob.py index 2609d546ef499..3c1aa474c2a36 100644 --- a/storage/tests/unit/test_blob.py +++ b/storage/tests/unit/test_blob.py @@ -1928,7 +1928,7 @@ def test_get_iam_policy(self): BLOB_NAME = "blob-name" PATH = "/b/name/o/%s" % (BLOB_NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 OWNER1 = "user:phred@example.com" OWNER2 = "group:cloud-logs@google.com" EDITOR1 = "domain:google.com" @@ -1980,7 +1980,7 @@ def test_get_iam_policy_w_user_project(self): USER_PROJECT = "user-project-123" PATH = "/b/name/o/%s" % (BLOB_NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 RETURNED = { "resourceId": PATH, "etag": ETAG, @@ -2023,7 +2023,7 @@ def test_set_iam_policy(self): BLOB_NAME = "blob-name" PATH = "/b/name/o/%s" % (BLOB_NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 OWNER1 = "user:phred@example.com" OWNER2 = "group:cloud-logs@google.com" EDITOR1 = "domain:google.com" @@ -2074,7 +2074,7 @@ def test_set_iam_policy_w_user_project(self): USER_PROJECT = "user-project-123" PATH = "/b/name/o/%s" % (BLOB_NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 BINDINGS = [] RETURNED = {"etag": ETAG, "version": VERSION, "bindings": BINDINGS} after = ({"status": http_client.OK}, RETURNED) diff --git a/storage/tests/unit/test_bucket.py b/storage/tests/unit/test_bucket.py index 41918874b4b64..1b3821f63010a 100644 --- a/storage/tests/unit/test_bucket.py +++ b/storage/tests/unit/test_bucket.py @@ -2023,7 +2023,7 @@ def test_get_iam_policy(self): NAME = "name" PATH = "/b/%s" % (NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 OWNER1 = "user:phred@example.com" OWNER2 = "group:cloud-logs@google.com" EDITOR1 = "domain:google.com" @@ -2067,7 +2067,7 @@ def test_get_iam_policy_w_user_project(self): USER_PROJECT = "user-project-123" PATH = "/b/%s" % (NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 RETURNED = { "resourceId": PATH, "etag": ETAG, @@ -2102,7 +2102,7 @@ def test_set_iam_policy(self): NAME = "name" PATH = "/b/%s" % (NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 OWNER1 = "user:phred@example.com" OWNER2 = "group:cloud-logs@google.com" EDITOR1 = "domain:google.com" @@ -2155,7 +2155,7 @@ def test_set_iam_policy_w_user_project(self): USER_PROJECT = "user-project-123" PATH = "/b/%s" % (NAME,) ETAG = "DEADBEEF" - VERSION = 17 + VERSION = 1 OWNER1 = "user:phred@example.com" OWNER2 = "group:cloud-logs@google.com" EDITOR1 = "domain:google.com"