Skip to content

Commit 081abdc

Browse files
committed
fix(gapic-generator): use flat_ref_types in unit test templates and delete remove-unused-imports post-processor
1 parent 4f21b8b commit 081abdc

3 files changed

Lines changed: 2 additions & 35 deletions

File tree

.librarian/generator-input/client-post-processing/remove-unused-imports.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/gapic-generator/gapic/ads-templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ from google.longrunning import operations_pb2 # type: ignore
5757
{% endif %}
5858
from google.api_core import gapic_v1
5959
{% for method in service.methods.values() %}
60-
{% for ref_type in method.ref_types
60+
{% for ref_type in method.flat_ref_types
6161
if not ((ref_type.ident.python_import.package == ('google', 'api_core') and ref_type.ident.python_import.module == 'operation')
6262
or ref_type.ident.python_import.package == ('google', 'protobuf') and ref_type.ident.python_import.module == 'empty_pb2') %}
6363
{{ ref_type.ident.python_import }}

packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ from google.longrunning import operations_pb2 # type: ignore
8686
{% endif %}
8787
from google.api_core import gapic_v1
8888
{% for method in service.methods.values() %}
89-
{% for ref_type in method.ref_types
89+
{% for ref_type in method.flat_ref_types
9090
if not (ref_type.ident.python_import.package == ('google', 'api_core') and ref_type.ident.python_import.module == 'operation') %}
9191
{{ ref_type.ident.python_import }}
9292
{% endfor %}

0 commit comments

Comments
 (0)