Skip to content

Commit 5849780

Browse files
committed
revert changes
1 parent 42e0527 commit 5849780

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,27 +2382,26 @@ def test_{{ service.name|snake_case }}_grpc_lro_client():
23822382
{% endif %} {# if grpc in opts #}
23832383

23842384
{% with molluscs = cycler("squid", "clam", "whelk", "octopus", "oyster", "nudibranch", "cuttlefish", "mussel", "winkle", "nautilus", "scallop", "abalone") %}
2385-
{% for message in service.resource_messages %}
2386-
{% set method_base_name = service.resource_path_method_names[message.resource_type_full_path] %}
2387-
def test_{{ method_base_name }}_path():
2385+
{% for message in service.resource_messages|sort(attribute="resource_type") %}
2386+
def test_{{ message.resource_type|snake_case }}_path():
23882387
{% for arg in message.resource_path_args %}
23892388
{{ arg }} = "{{ molluscs.next() }}"
23902389
{% endfor %}
23912390
expected = "{{ message.resource_path_formatted }}".format({% for arg in message.resource_path_args %}{{ arg }}={{ arg }}, {% endfor %})
2392-
actual = {{ service.client_name }}.{{ method_base_name }}_path({{message.resource_path_args|join(", ") }})
2391+
actual = {{ service.client_name }}.{{ message.resource_type|snake_case }}_path({{message.resource_path_args|join(", ") }})
23932392
assert expected == actual
23942393

23952394

2396-
def test_parse_{{ method_base_name }}_path():
2395+
def test_parse_{{ message.resource_type|snake_case }}_path():
23972396
expected = {
23982397
{% for arg in message.resource_path_args %}
23992398
"{{ arg }}": "{{ molluscs.next() }}",
24002399
{% endfor %}
24012400
}
2402-
path = {{ service.client_name }}.{{ method_base_name }}_path(**expected)
2401+
path = {{ service.client_name }}.{{ message.resource_type|snake_case }}_path(**expected)
24032402

24042403
# Check that the path construction is reversible.
2405-
actual = {{ service.client_name }}.parse_{{ method_base_name }}_path(path)
2404+
actual = {{ service.client_name }}.parse_{{ message.resource_type|snake_case }}_path(path)
24062405
assert expected == actual
24072406

24082407
{% endfor %}

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,27 +1788,26 @@ def test_{{ service.name|snake_case }}_grpc_lro_async_client():
17881788
{% endif %} {# if grpc in opts #}
17891789

17901790
{% with molluscs = cycler("squid", "clam", "whelk", "octopus", "oyster", "nudibranch", "cuttlefish", "mussel", "winkle", "nautilus", "scallop", "abalone") %}
1791-
{% for message in service.resource_messages %}
1792-
{% set method_base_name = service.resource_path_method_names[message.resource_type_full_path] %}
1793-
def test_{{ method_base_name }}_path():
1791+
{% for message in service.resource_messages|sort(attribute="resource_type") %}
1792+
def test_{{ message.resource_type|snake_case }}_path():
17941793
{% for arg in message.resource_path_args %}
17951794
{{ arg }} = "{{ molluscs.next() }}"
17961795
{% endfor %}
17971796
expected = "{{ message.resource_path_formatted }}".format({% for arg in message.resource_path_args %}{{ arg }}={{ arg }}, {% endfor %})
1798-
actual = {{ service.client_name }}.{{ method_base_name }}_path({{message.resource_path_args|join(", ") }})
1797+
actual = {{ service.client_name }}.{{ message.resource_type|snake_case }}_path({{message.resource_path_args|join(", ") }})
17991798
assert expected == actual
18001799

18011800

1802-
def test_parse_{{ method_base_name }}_path():
1801+
def test_parse_{{ message.resource_type|snake_case }}_path():
18031802
expected = {
18041803
{% for arg in message.resource_path_args %}
18051804
"{{ arg }}": "{{ molluscs.next() }}",
18061805
{% endfor %}
18071806
}
1808-
path = {{ service.client_name }}.{{ method_base_name }}_path(**expected)
1807+
path = {{ service.client_name }}.{{ message.resource_type|snake_case }}_path(**expected)
18091808

18101809
# Check that the path construction is reversible.
1811-
actual = {{ service.client_name }}.parse_{{ method_base_name }}_path(path)
1810+
actual = {{ service.client_name }}.parse_{{ message.resource_type|snake_case }}_path(path)
18121811
assert expected == actual
18131812

18141813
{% endfor %}

0 commit comments

Comments
 (0)