googleapis/python-org-policy

tests.unit.gapic.orgpolicy_v2.test_org_policy: test_list_constraints_pager failed

Closed this issue · 4 comments

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: 10b1667
buildURL: Build Status, Sponge
status: failed

Test output
transport_name = 'grpc'
def test_list_constraints_pager(transport_name: str = "grpc"):
    client = OrgPolicyClient(
        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_constraints), "__call__") as call:
        # Set the response to a series of pages.
        call.side_effect = (
            orgpolicy.ListConstraintsResponse(
                constraints=[
                    constraint.Constraint(),
                    constraint.Constraint(),
                    constraint.Constraint(),
                ],
                next_page_token="abc",
            ),
            orgpolicy.ListConstraintsResponse(
                constraints=[],
                next_page_token="def",
            ),
            orgpolicy.ListConstraintsResponse(
                constraints=[
                    constraint.Constraint(),
                ],
                next_page_token="ghi",
            ),
            orgpolicy.ListConstraintsResponse(
                constraints=[
                    constraint.Constraint(),
                    constraint.Constraint(),
                ],
            ),
            RuntimeError,
        )

        metadata = ()
        metadata = tuple(metadata) + (
            gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)),
        )
        pager = client.list_constraints(request={})

        assert pager._metadata == metadata

        results = list(pager)
        assert len(results) == 6
      assert all(isinstance(i, constraint.Constraint) for i in results)

E assert False
E + where False = all(<generator object test_list_constraints_pager.. at 0x7f661a033b50>)

tests/unit/gapic/orgpolicy_v2/test_org_policy.py:905: AssertionError

Test passed for commit e88e34c (Build Status, Sponge)! Closing this issue.

Test passed for commit e88e34c (Build Status, Sponge)! Closing this issue.

Test passed for commit e88e34c (Build Status, Sponge)! Closing this issue.

Test passed for commit e88e34c (Build Status, Sponge)! Closing this issue.