assert False
+ where False = all(<generator object test_list_instances_pager.<locals>.<genexpr> at 0x7f4a2a5765e0>)
transport_name = 'grpc'
def test_list_instances_pager(transport_name: str = "grpc"):
client = CloudMemcacheClient(
credentials=ga_credentials.AnonymousCredentials,
transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.list_instances), "__call__") as call:
# Set the response to a series of pages.
call.side_effect = (
cloud_memcache.ListInstancesResponse(
instances=[
cloud_memcache.Instance(),
cloud_memcache.Instance(),
cloud_memcache.Instance(),
],
next_page_token="abc",
),
cloud_memcache.ListInstancesResponse(
instances=[],
next_page_token="def",
),
cloud_memcache.ListInstancesResponse(
instances=[
cloud_memcache.Instance(),
],
next_page_token="ghi",
),
cloud_memcache.ListInstancesResponse(
instances=[
cloud_memcache.Instance(),
cloud_memcache.Instance(),
],
),
RuntimeError,
)
metadata = ()
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)),
)
pager = client.list_instances(request={})
assert pager._metadata == metadata
results = list(pager)
assert len(results) == 6
> assert all(isinstance(i, cloud_memcache.Instance) for i in results)
E assert False
E + where False = all(<generator object test_list_instances_pager.<locals>.<genexpr> at 0x7f4a2a5765e0>)
tests/unit/gapic/memcache_v1/test_cloud_memcache.py:941: AssertionError
+ where False = all(<generator object test_list_instances_pager.<locals>.<genexpr> at 0x7f4a2a5765e0>)
transport_name = 'grpc'
def test_list_instances_pager(transport_name: str = "grpc"):
client = CloudMemcacheClient(
credentials=ga_credentials.AnonymousCredentials,
transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.list_instances), "__call__") as call:
# Set the response to a series of pages.
call.side_effect = (
cloud_memcache.ListInstancesResponse(
instances=[
cloud_memcache.Instance(),
cloud_memcache.Instance(),
cloud_memcache.Instance(),
],
next_page_token="abc",
),
cloud_memcache.ListInstancesResponse(
instances=[],
next_page_token="def",
),
cloud_memcache.ListInstancesResponse(
instances=[
cloud_memcache.Instance(),
],
next_page_token="ghi",
),
cloud_memcache.ListInstancesResponse(
instances=[
cloud_memcache.Instance(),
cloud_memcache.Instance(),
],
),
RuntimeError,
)
metadata = ()
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)),
)
pager = client.list_instances(request={})
assert pager._metadata == metadata
results = list(pager)
assert len(results) == 6
> assert all(isinstance(i, cloud_memcache.Instance) for i in results)
E assert False
E + where False = all(<generator object test_list_instances_pager.<locals>.<genexpr> at 0x7f4a2a5765e0>)
tests/unit/gapic/memcache_v1/test_cloud_memcache.py:941: AssertionError
assert False + where False = all(<generator object test_list_instances_pager.<locals>.<genexpr> at 0x7f4a2a5765e0>) transport_name = 'grpc' def test_list_instances_pager(transport_name: str = "grpc"): client = CloudMemcacheClient( credentials=ga_credentials.AnonymousCredentials, transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_instances), "__call__") as call: # Set the response to a series of pages. call.side_effect = ( cloud_memcache.ListInstancesResponse( instances=[ cloud_memcache.Instance(), cloud_memcache.Instance(), cloud_memcache.Instance(), ], next_page_token="abc", ), cloud_memcache.ListInstancesResponse( instances=[], next_page_token="def", ), cloud_memcache.ListInstancesResponse( instances=[ cloud_memcache.Instance(), ], next_page_token="ghi", ), cloud_memcache.ListInstancesResponse( instances=[ cloud_memcache.Instance(), cloud_memcache.Instance(), ], ), RuntimeError, ) metadata = () metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), ) pager = client.list_instances(request={}) assert pager._metadata == metadata results = list(pager) assert len(results) == 6 > assert all(isinstance(i, cloud_memcache.Instance) for i in results) E assert False E + where False = all(<generator object test_list_instances_pager.<locals>.<genexpr> at 0x7f4a2a5765e0>) tests/unit/gapic/memcache_v1/test_cloud_memcache.py:941: AssertionError