Skip to content

Commit

Permalink
fix: tweak param name further
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Feb 13, 2020
1 parent ca55815 commit b75fd1d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions google/cloud/storage/blob.py
Expand Up @@ -361,7 +361,7 @@ def generate_signed_url(
version=None,
service_account_email=None,
access_token=None,
virtual_host_style=False,
virtual_hosted_style=False,
):
"""Generates a signed URL for this blob.
Expand Down Expand Up @@ -455,8 +455,8 @@ def generate_signed_url(
:type access_token: str
:param access_token: (Optional) Access token for a service account.
:type virtual_host_style: bool
:param virtual_host_style:
:type virtual_hosted_style: bool
:param virtual_hosted_style:
(Optional) If true, then construct the URL relative the bucket's
virtual hostname, e.g., '<bucket-name>.storage.googleapis.com'.
Expand All @@ -476,7 +476,7 @@ def generate_signed_url(

quoted_name = _quote(self.name, safe=b"/~")

if virtual_host_style:
if virtual_hosted_style:
api_access_endpoint = "https://{bucket_name}.storage.googleapis.com".format(
bucket_name=self.bucket.name
)
Expand Down
8 changes: 4 additions & 4 deletions google/cloud/storage/bucket.py
Expand Up @@ -2354,7 +2354,7 @@ def generate_signed_url(
client=None,
credentials=None,
version=None,
virtual_host_style=False,
virtual_hosted_style=False,
):
"""Generates a signed URL for this bucket.
Expand Down Expand Up @@ -2417,8 +2417,8 @@ def generate_signed_url(
:param version: (Optional) The version of signed credential to create.
Must be one of 'v2' | 'v4'.
:type virtual_host_style: bool
:param virtual_host_style:
:type virtual_hosted_style: bool
:param virtual_hosted_style:
(Optional) If true, then construct the URL relative the bucket's
virtual hostname, e.g., '<bucket-name>.storage.googleapis.com'.
Expand All @@ -2436,7 +2436,7 @@ def generate_signed_url(
elif version not in ("v2", "v4"):
raise ValueError("'version' must be either 'v2' or 'v4'")

if virtual_host_style:
if virtual_hosted_style:
api_access_endpoint = "https://{bucket_name}.storage.googleapis.com".format(
bucket_name=self.name
)
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_blob.py
Expand Up @@ -399,7 +399,7 @@ def _generate_signed_url_helper(
encryption_key=None,
access_token=None,
service_account_email=None,
virtual_host_style=False,
virtual_hosted_style=False,
):
from six.moves.urllib import parse
from google.cloud._helpers import UTC
Expand Down Expand Up @@ -443,7 +443,7 @@ def _generate_signed_url_helper(
version=version,
access_token=access_token,
service_account_email=service_account_email,
virtual_host_style=virtual_host_style,
virtual_hosted_style=virtual_hosted_style,
)

self.assertEqual(signed_uri, signer.return_value)
Expand All @@ -456,7 +456,7 @@ def _generate_signed_url_helper(
encoded_name = blob_name.encode("utf-8")
quoted_name = parse.quote(encoded_name, safe=b"/~")

if virtual_host_style:
if virtual_hosted_style:
expected_api_access_endpoint = "https://{}.storage.googleapis.com".format(
bucket.name
)
Expand Down Expand Up @@ -617,7 +617,7 @@ def test_generate_signed_url_v4_w_csek_and_headers(self):
)

def test_generate_signed_url_v4_w_virtual_hostname(self):
self._generate_signed_url_v4_helper(virtual_host_style=True)
self._generate_signed_url_v4_helper(virtual_hosted_style=True)

def test_generate_signed_url_v4_w_credentials(self):
credentials = object()
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_bucket.py
Expand Up @@ -2739,7 +2739,7 @@ def _generate_signed_url_helper(
query_parameters=None,
credentials=None,
expiration=None,
virtual_host_style=False,
virtual_hosted_style=False,
):
from six.moves.urllib import parse
from google.cloud._helpers import UTC
Expand Down Expand Up @@ -2774,7 +2774,7 @@ def _generate_signed_url_helper(
headers=headers,
query_parameters=query_parameters,
version=version,
virtual_host_style=virtual_host_style,
virtual_hosted_style=virtual_hosted_style,
)

self.assertEqual(signed_uri, signer.return_value)
Expand All @@ -2784,7 +2784,7 @@ def _generate_signed_url_helper(
else:
expected_creds = credentials

if virtual_host_style:
if virtual_hosted_style:
expected_api_access_endpoint = "https://{}.storage.googleapis.com".format(
bucket_name
)
Expand Down Expand Up @@ -2926,7 +2926,7 @@ def test_generate_signed_url_v4_w_credentials(self):
self._generate_signed_url_v4_helper(credentials=credentials)

def test_generate_signed_url_v4_w_virtual_hostname(self):
self._generate_signed_url_v4_helper(virtual_host_style=True)
self._generate_signed_url_v4_helper(virtual_hosted_style=True)


class _Connection(object):
Expand Down

0 comments on commit b75fd1d

Please sign in to comment.