From e206be2b5dada7565b1a4f6a6354d492e39dd47a Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 4 Nov 2019 12:50:36 +0300 Subject: [PATCH] Test for user_project query parameter. --- storage/tests/unit/test_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/tests/unit/test_client.py b/storage/tests/unit/test_client.py index f8a857d164a0..b1623f3c5392 100644 --- a/storage/tests/unit/test_client.py +++ b/storage/tests/unit/test_client.py @@ -521,6 +521,7 @@ def test_create_bucket_with_string_conflict(self): from google.cloud.exceptions import Conflict project = "PROJECT" + user_project = "USER_PROJECT" other_project = "OTHER_PROJECT" credentials = _make_credentials() client = self._make_one(project=project, credentials=credentials) @@ -531,7 +532,7 @@ def test_create_bucket_with_string_conflict(self): client._connection.API_BASE_URL, "storage", client._connection.API_VERSION, - "b?project=%s" % (other_project,), + "b?project=%s&userProject=%s" % (other_project, user_project), ] ) data = {"error": {"message": "Conflict"}} @@ -542,7 +543,7 @@ def test_create_bucket_with_string_conflict(self): client._http_internal = http with self.assertRaises(Conflict): - client.create_bucket(bucket_name, project=other_project) + client.create_bucket(bucket_name, project=other_project, user_project=user_project) http.request.assert_called_once_with( method="POST", url=URI, data=mock.ANY, headers=mock.ANY