@pytest.mark.asyncio
async def test_list_game_server_deployments_async_pager():
client = GameServerDeploymentsServiceAsyncClient(
credentials=ga_credentials.AnonymousCredentials,
)
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
type(client.transport.list_game_server_deployments),
"__call__",
new_callable=mock.AsyncMock,
) as call:
# Set the response to a series of pages.
call.side_effect = (
game_server_deployments.ListGameServerDeploymentsResponse(
game_server_deployments=[
game_server_deployments.GameServerDeployment(),
game_server_deployments.GameServerDeployment(),
game_server_deployments.GameServerDeployment(),
],
next_page_token="abc",
),
game_server_deployments.ListGameServerDeploymentsResponse(
game_server_deployments=[],
next_page_token="def",
),
game_server_deployments.ListGameServerDeploymentsResponse(
game_server_deployments=[
game_server_deployments.GameServerDeployment(),
],
next_page_token="ghi",
),
game_server_deployments.ListGameServerDeploymentsResponse(
game_server_deployments=[
game_server_deployments.GameServerDeployment(),
game_server_deployments.GameServerDeployment(),
],
),
RuntimeError,
)
async_pager = await client.list_game_server_deployments(
request={},
)
assert async_pager.next_page_token == "abc"
responses = []
async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
> assert all(
isinstance(i, game_server_deployments.GameServerDeployment)
for i in responses
)
E assert False
E + where False = all(. at 0x7f064486e250>)
tests/unit/gapic/gaming_v1/test_game_server_deployments_service.py:1087: AssertionError
This test failed!
To configure my behavior, see the Flaky Bot documentation.
If I'm commenting on this issue too often, add the
flakybot: quiet
label and I will stop commenting.commit: 7598cb6275b1a587ed6a1f63f3d209861f24a32e buildURL: Build Status, Sponge status: failed
Test output