Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google/cloud/kms_v1/services/ekm_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ async def test_iam_permissions(
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "EkmServiceAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/kms_v1/services/ekm_service/transports/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ def __call__(
request_kwargs = json_format.MessageToDict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)

body = json.loads(json.dumps(transcoded_request["body"]))
body = json.dumps(transcoded_request["body"])
uri = transcoded_request["uri"]
method = transcoded_request["method"]

Expand Down Expand Up @@ -1649,7 +1649,7 @@ def __call__(
request_kwargs = json_format.MessageToDict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)

body = json.loads(json.dumps(transcoded_request["body"]))
body = json.dumps(transcoded_request["body"])
uri = transcoded_request["uri"]
method = transcoded_request["method"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4329,7 +4329,7 @@ async def test_iam_permissions(
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "KeyManagementServiceAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4519,7 +4519,7 @@ def __call__(
request_kwargs = json_format.MessageToDict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)

body = json.loads(json.dumps(transcoded_request["body"]))
body = json.dumps(transcoded_request["body"])
uri = transcoded_request["uri"]
method = transcoded_request["method"]

Expand Down Expand Up @@ -4611,7 +4611,7 @@ def __call__(
request_kwargs = json_format.MessageToDict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)

body = json.loads(json.dumps(transcoded_request["body"]))
body = json.dumps(transcoded_request["body"])
uri = transcoded_request["uri"]
method = transcoded_request["method"]

Expand Down
6 changes: 4 additions & 2 deletions tests/unit/gapic/kms_v1/test_ekm_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,11 @@ async def test_list_ekm_connections_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_ekm_connections(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down
32 changes: 16 additions & 16 deletions tests/unit/gapic/kms_v1/test_key_management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,11 @@ async def test_list_key_rings_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_key_rings(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -1599,9 +1601,11 @@ async def test_list_crypto_keys_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_crypto_keys(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -2045,9 +2049,11 @@ async def test_list_crypto_key_versions_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_crypto_key_versions(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -2469,9 +2475,11 @@ async def test_list_import_jobs_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_import_jobs(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -2730,7 +2738,6 @@ def test_get_crypto_key(request_type, transport: str = "grpc"):
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)
response = client.get_crypto_key(request)

Expand Down Expand Up @@ -4009,7 +4016,6 @@ def test_create_crypto_key(request_type, transport: str = "grpc"):
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)
response = client.create_crypto_key(request)

Expand Down Expand Up @@ -5080,7 +5086,6 @@ def test_update_crypto_key(request_type, transport: str = "grpc"):
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)
response = client.update_crypto_key(request)

Expand Down Expand Up @@ -5651,7 +5656,6 @@ def test_update_crypto_key_primary_version(request_type, transport: str = "grpc"
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)
response = client.update_crypto_key_primary_version(request)

Expand Down Expand Up @@ -10325,7 +10329,6 @@ def test_get_crypto_key_rest(request_type):
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)

# Wrap the value into a proper Response obj
Expand Down Expand Up @@ -11798,7 +11801,6 @@ def test_create_crypto_key_rest(request_type):
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)

# Wrap the value into a proper Response obj
Expand Down Expand Up @@ -13199,7 +13201,6 @@ def test_update_crypto_key_rest(request_type):
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)

# Wrap the value into a proper Response obj
Expand Down Expand Up @@ -13918,7 +13919,6 @@ def test_update_crypto_key_primary_version_rest(request_type):
purpose=resources.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT,
import_only=True,
crypto_key_backend="crypto_key_backend_value",
rotation_period=duration_pb2.Duration(seconds=751),
)

# Wrap the value into a proper Response obj
Expand Down