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
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ async def sample_update_alert_policy():
# Done; return the response.
return response

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ async def sample_list_group_members():
# Done; return the response.
return response

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ async def sample_create_service_time_series():
metadata=metadata,
)

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ async def sample_verify_notification_channel():
# Done; return the response.
return response

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ async def sample_query_time_series():
# Done; return the response.
return response

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ async def sample_delete_service_level_objective():
metadata=metadata,
)

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ async def sample_update_snooze():
# Done; return the response.
return response

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ async def sample_list_uptime_check_ips():
# Done; return the response.
return response

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

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-monitoring",
"version": "2.15.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/gapic/monitoring_v3/test_alert_policy_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,9 +1150,11 @@ async def test_list_alert_policies_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_alert_policies(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
12 changes: 8 additions & 4 deletions tests/unit/gapic/monitoring_v3/test_group_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,9 +1088,11 @@ async def test_list_groups_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_groups(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 @@ -2500,9 +2502,11 @@ async def test_list_group_members_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_group_members(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
18 changes: 12 additions & 6 deletions tests/unit/gapic/monitoring_v3/test_metric_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,11 @@ async def test_list_monitored_resource_descriptors_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_monitored_resource_descriptors(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 @@ -1843,9 +1845,11 @@ async def test_list_metric_descriptors_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_metric_descriptors(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 @@ -3100,9 +3104,11 @@ async def test_list_time_series_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_time_series(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
Original file line number Diff line number Diff line change
Expand Up @@ -1181,9 +1181,11 @@ async def test_list_notification_channel_descriptors_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_notification_channel_descriptors(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 @@ -1895,9 +1897,11 @@ async def test_list_notification_channels_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_notification_channels(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
6 changes: 4 additions & 2 deletions tests/unit/gapic/monitoring_v3/test_query_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,11 @@ async def test_query_time_series_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.query_time_series(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
21 changes: 11 additions & 10 deletions tests/unit/gapic/monitoring_v3/test_service_monitoring_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ def test_create_service(request_type, transport: str = "grpc"):
call.return_value = gm_service.Service(
name="name_value",
display_name="display_name_value",
custom=None,
)
response = client.create_service(request)

Expand Down Expand Up @@ -989,7 +988,6 @@ def test_get_service(request_type, transport: str = "grpc"):
call.return_value = service.Service(
name="name_value",
display_name="display_name_value",
custom=None,
)
response = client.get_service(request)

Expand Down Expand Up @@ -1611,9 +1609,11 @@ async def test_list_services_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_services(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 @@ -1642,7 +1642,6 @@ def test_update_service(request_type, transport: str = "grpc"):
call.return_value = gm_service.Service(
name="name_value",
display_name="display_name_value",
custom=None,
)
response = client.update_service(request)

Expand Down Expand Up @@ -2098,7 +2097,7 @@ def test_create_service_level_objective(request_type, transport: str = "grpc"):
name="name_value",
display_name="display_name_value",
goal=0.419,
rolling_period=duration_pb2.Duration(seconds=751),
calendar_period=calendar_period_pb2.CalendarPeriod.DAY,
)
response = client.create_service_level_objective(request)

Expand Down Expand Up @@ -2364,7 +2363,7 @@ def test_get_service_level_objective(request_type, transport: str = "grpc"):
name="name_value",
display_name="display_name_value",
goal=0.419,
rolling_period=duration_pb2.Duration(seconds=751),
calendar_period=calendar_period_pb2.CalendarPeriod.DAY,
)
response = client.get_service_level_objective(request)

Expand Down Expand Up @@ -3029,9 +3028,11 @@ async def test_list_service_level_objectives_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_service_level_objectives(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 @@ -3063,7 +3064,7 @@ def test_update_service_level_objective(request_type, transport: str = "grpc"):
name="name_value",
display_name="display_name_value",
goal=0.419,
rolling_period=duration_pb2.Duration(seconds=751),
calendar_period=calendar_period_pb2.CalendarPeriod.DAY,
)
response = client.update_service_level_objective(request)

Expand Down
6 changes: 4 additions & 2 deletions tests/unit/gapic/monitoring_v3/test_snooze_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1343,9 +1343,11 @@ async def test_list_snoozes_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_snoozes(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
30 changes: 8 additions & 22 deletions tests/unit/gapic/monitoring_v3/test_uptime_check_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,9 +1146,11 @@ async def test_list_uptime_check_configs_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_uptime_check_configs(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 @@ -1182,12 +1184,6 @@ def test_get_uptime_check_config(request_type, transport: str = "grpc"):
checker_type=uptime.UptimeCheckConfig.CheckerType.STATIC_IP_CHECKERS,
selected_regions=[uptime.UptimeCheckRegion.USA],
is_internal=True,
monitored_resource=monitored_resource_pb2.MonitoredResource(
type="type_value"
),
http_check=uptime.UptimeCheckConfig.HttpCheck(
request_method=uptime.UptimeCheckConfig.HttpCheck.RequestMethod.GET
),
)
response = client.get_uptime_check_config(request)

Expand Down Expand Up @@ -1455,12 +1451,6 @@ def test_create_uptime_check_config(request_type, transport: str = "grpc"):
checker_type=uptime.UptimeCheckConfig.CheckerType.STATIC_IP_CHECKERS,
selected_regions=[uptime.UptimeCheckRegion.USA],
is_internal=True,
monitored_resource=monitored_resource_pb2.MonitoredResource(
type="type_value"
),
http_check=uptime.UptimeCheckConfig.HttpCheck(
request_method=uptime.UptimeCheckConfig.HttpCheck.RequestMethod.GET
),
)
response = client.create_uptime_check_config(request)

Expand Down Expand Up @@ -1738,12 +1728,6 @@ def test_update_uptime_check_config(request_type, transport: str = "grpc"):
checker_type=uptime.UptimeCheckConfig.CheckerType.STATIC_IP_CHECKERS,
selected_regions=[uptime.UptimeCheckRegion.USA],
is_internal=True,
monitored_resource=monitored_resource_pb2.MonitoredResource(
type="type_value"
),
http_check=uptime.UptimeCheckConfig.HttpCheck(
request_method=uptime.UptimeCheckConfig.HttpCheck.RequestMethod.GET
),
)
response = client.update_uptime_check_config(request)

Expand Down Expand Up @@ -2499,9 +2483,11 @@ async def test_list_uptime_check_ips_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_uptime_check_ips(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