-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
While running tests (via gbazelisk test //google3/google/cloud/...) an error came up:
The error appears to be related to a mismatch in response type for GRPC and HTTP.
assert len(responses) == 6
> assert all(isinstance(i, struct_pb2.ListValue)
for i in responses)
E assert False
E + where False = all(<generator object test_read_report_async_pager.<locals>.<genexpr> at 0x7f6adfab8660>)
google/cloud/appoptimize/v1alpha/appoptimize_py_gapic_srcjar.py/tests/unit/gapic/appoptimize_v1alpha/test_app_optimize.py:2890: AssertionError
_________________________ test_read_report_rest_pager __________________________
Specifically, when you compare gRPC and HTTP responses:
- gRPC typically returns the actual Protobuf Message object (e.g., an instance of
struct_pb2.ListValue). - HTTP/REST (using libraries like
requestsoraiohttp) usually returns native Python types (e.g., a standardlistordict) after the JSON body is decoded.
Modify the test to compare these two items via an isinstance check against Sequence (which is a superclass of both ListValue and list).
Metadata
Metadata
Assignees
Labels
No labels