@@ -8,7 +8,6 @@ import grpc
88from grpc.experimental import aio
99import math
1010import pytest
11- from proto.marshal.rules.dates import DurationRule, TimestampRule
1211
1312{# Import the service itself as well as every proto module that it imports. -#}
1413{% filter sort_lines -%}
@@ -575,13 +574,7 @@ def test_{{ method.name|snake_case }}_flattened():
575574 assert len(call.mock_calls) == 1
576575 _, args, _ = call.mock_calls[0]
577576 {% for key , field in method .flattened_fields .items () -%}{% - if not field .oneof or field .proto 3_optional %}
578- {% if field .ident |string () == 'timestamp.Timestamp' -%}
579- assert TimestampRule().to_proto(args[0].{{ key }}) == {{ field.mock_value }}
580- {% elif field .ident |string () == 'duration.Duration' -%}
581- assert DurationRule().to_proto(args[0].{{ key }}) == {{ field.mock_value }}
582- {% else -%}
583577 assert args[0].{{ key }} == {{ field.mock_value }}
584- {% endif %}
585578 {% endif %}{% endfor %}
586579 {% - for oneofs in method .flattened_oneof_fields ().values () %}
587580 {% - with field = oneofs [-1] %}
@@ -660,13 +653,7 @@ async def test_{{ method.name|snake_case }}_flattened_async():
660653 assert len(call.mock_calls)
661654 _, args, _ = call.mock_calls[0]
662655 {% for key , field in method .flattened_fields .items () -%}{% - if not field .oneof or field .proto 3_optional %}
663- {% if field .ident |string () == 'timestamp.Timestamp' -%}
664- assert TimestampRule().to_proto(args[0].{{ key }}) == {{ field.mock_value }}
665- {% elif field .ident |string () == 'duration.Duration' -%}
666- assert DurationRule().to_proto(args[0].{{ key }}) == {{ field.mock_value }}
667- {% else -%}
668656 assert args[0].{{ key }} == {{ field.mock_value }}
669- {% endif %}
670657 {% endif %}{% endfor %}
671658 {% - for oneofs in method .flattened_oneof_fields ().values () %}
672659 {% - with field = oneofs [-1] %}
0 commit comments