From aeb83fb34fd296ef93e563f10d4c4c54baf6f68e Mon Sep 17 00:00:00 2001 From: vam-google Date: Fri, 5 Nov 2021 15:43:18 -0700 Subject: [PATCH] fix: fix rest unit test In some cases `hostname:port` format was expected. --- .../tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 index eb4877d22b..541ff03124 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 @@ -1293,7 +1293,7 @@ def test_{{ method.name|snake_case }}_rest_flattened(transport: str = 'rest'): assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] {% with uri = method.http_options[0].uri %} - assert path_template.validate("https://{{ service.host }}{{ uri }}", args[1]) + assert path_template.validate("https://%s{{ uri }}" % client.transport._host, args[1]) {% endwith %} {# TODO(kbandes) - reverse-transcode request args to check all request fields #}