Skip to content

Commit adbf6fb

Browse files
fix: Add async context manager return types (#161)
* fix: Add async context manager return types chore: Mock return_value should not populate oneof message fields chore: Support snippet generation for services that only support REST transport chore: Update gapic-generator-python to v1.11.0 PiperOrigin-RevId: 545430278 Source-Link: googleapis/googleapis@601b532 Source-Link: googleapis/googleapis-gen@b3f18d0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjNmMThkMGY2NTYwYTg1NTAyMmZkMDU4ODY1ZTc2MjA0NzlkN2FmOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 4737e7b commit adbf6fb

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

packages/google-cloud-video-stitcher/google/cloud/video/stitcher_v1/services/video_stitcher_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3363,7 +3363,7 @@ async def cancel_operation(
33633363
metadata=metadata,
33643364
)
33653365

3366-
async def __aenter__(self):
3366+
async def __aenter__(self) -> "VideoStitcherServiceAsyncClient":
33673367
return self
33683368

33693369
async def __aexit__(self, exc_type, exc, tb):

packages/google-cloud-video-stitcher/samples/generated_samples/snippet_metadata_google.cloud.video.stitcher.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-video-stitcher",
11-
"version": "0.7.2"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-video-stitcher/tests/unit/gapic/stitcher_v1/test_video_stitcher_service.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,9 +1402,11 @@ async def test_list_cdn_keys_async_pages():
14021402
RuntimeError,
14031403
)
14041404
pages = []
1405-
async for page_ in (
1405+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
1406+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
1407+
async for page_ in ( # pragma: no branch
14061408
await client.list_cdn_keys(request={})
1407-
).pages: # pragma: no branch
1409+
).pages:
14081410
pages.append(page_)
14091411
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
14101412
assert page_.raw_page.next_page_token == token
@@ -1433,7 +1435,6 @@ def test_get_cdn_key(request_type, transport: str = "grpc"):
14331435
call.return_value = cdn_keys.CdnKey(
14341436
name="name_value",
14351437
hostname="hostname_value",
1436-
google_cdn_key=cdn_keys.GoogleCdnKey(private_key=b"private_key_blob"),
14371438
)
14381439
response = client.get_cdn_key(request)
14391440

@@ -3077,9 +3078,11 @@ async def test_list_vod_stitch_details_async_pages():
30773078
RuntimeError,
30783079
)
30793080
pages = []
3080-
async for page_ in (
3081+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
3082+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
3083+
async for page_ in ( # pragma: no branch
30813084
await client.list_vod_stitch_details(request={})
3082-
).pages: # pragma: no branch
3085+
).pages:
30833086
pages.append(page_)
30843087
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
30853088
assert page_.raw_page.next_page_token == token
@@ -3767,9 +3770,11 @@ async def test_list_vod_ad_tag_details_async_pages():
37673770
RuntimeError,
37683771
)
37693772
pages = []
3770-
async for page_ in (
3773+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
3774+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
3775+
async for page_ in ( # pragma: no branch
37713776
await client.list_vod_ad_tag_details(request={})
3772-
).pages: # pragma: no branch
3777+
).pages:
37733778
pages.append(page_)
37743779
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
37753780
assert page_.raw_page.next_page_token == token
@@ -4457,9 +4462,11 @@ async def test_list_live_ad_tag_details_async_pages():
44574462
RuntimeError,
44584463
)
44594464
pages = []
4460-
async for page_ in (
4465+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
4466+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
4467+
async for page_ in ( # pragma: no branch
44614468
await client.list_live_ad_tag_details(request={})
4462-
).pages: # pragma: no branch
4469+
).pages:
44634470
pages.append(page_)
44644471
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
44654472
assert page_.raw_page.next_page_token == token
@@ -5376,9 +5383,11 @@ async def test_list_slates_async_pages():
53765383
RuntimeError,
53775384
)
53785385
pages = []
5379-
async for page_ in (
5386+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
5387+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
5388+
async for page_ in ( # pragma: no branch
53805389
await client.list_slates(request={})
5381-
).pages: # pragma: no branch
5390+
).pages:
53825391
pages.append(page_)
53835392
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
53845393
assert page_.raw_page.next_page_token == token
@@ -7286,9 +7295,11 @@ async def test_list_live_configs_async_pages():
72867295
RuntimeError,
72877296
)
72887297
pages = []
7289-
async for page_ in (
7298+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
7299+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
7300+
async for page_ in ( # pragma: no branch
72907301
await client.list_live_configs(request={})
7291-
).pages: # pragma: no branch
7302+
).pages:
72927303
pages.append(page_)
72937304
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
72947305
assert page_.raw_page.next_page_token == token

0 commit comments

Comments
 (0)