Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit fae9bd7

Browse files
committed
tests: fix generated test
1 parent e49ad70 commit fae9bd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gapic/ads-templates/tests/unit/gapic/%name_%version/%sub/_test_mixins.py.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def test_{{ name|snake_case }}_rest(request_type):
3030
transport="rest",
3131
)
3232
request_init = {{ api.mixin_http_options["{}".format(name)][0].sample_request }}
33-
request = request_type(**request_init)
33+
if request_type is dict:
34+
request = dict(request_init)
35+
else:
36+
# Native protobuf requires keyword arguments (**).
37+
request = request_type(**request_init)
3438
# Mock the http request call within the method and fake a response.
3539
with mock.patch.object(type(client.transport._session), 'request') as req:
3640
# Designate an appropriate value for the returned response.

0 commit comments

Comments
 (0)