File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
src/betterproto/templates Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 2
2
# sources: {{ ', '.join(output_file.input_filenames) }}
3
3
# plugin: python-betterproto
4
4
# This file has been @generated
5
+
6
+ __all__ = (
7
+ {% - for enum in output_file .enums -%}
8
+ "{{ enum.py_name }}",
9
+ {% - endfor -%}
10
+ {% - for message in output_file .messages -%}
11
+ "{{ message.py_name }}",
12
+ {% - endfor -%}
13
+ {% - for service in output_file .services -%}
14
+ "{{ service.py_name }}Stub",
15
+ "{{ service.py_name }}Base",
16
+ {% - endfor -%}
17
+ )
18
+
5
19
{% for i in output_file .python_module_imports |sort %}
6
20
import {{ i }}
7
21
{% endfor %}
Original file line number Diff line number Diff line change
1
+ def test_all_definition ():
2
+ """
3
+ Check that a compiled module defines __all__ with the right value.
4
+
5
+ These modules have been chosen since they contain messages, services and enums.
6
+ """
7
+ import tests .output_betterproto .enum as enum
8
+ import tests .output_betterproto .service as service
9
+
10
+ assert service .__all__ == (
11
+ "ThingType" ,
12
+ "DoThingRequest" ,
13
+ "DoThingResponse" ,
14
+ "GetThingRequest" ,
15
+ "GetThingResponse" ,
16
+ "TestStub" ,
17
+ "TestBase" ,
18
+ )
19
+ assert enum .__all__ == ("Choice" , "ArithmeticOperator" , "Test" )
You can’t perform that action at this time.
0 commit comments