From 3b2918ecaeb90229f22834438dc31755498ee2d0 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Fri, 5 Nov 2021 16:04:38 -0700 Subject: [PATCH] fix: fix rest unit test (#1074) 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 #}