Fixes #23 again, a broken test made it seem the issue was fixed before.
This commit is contained in:
		| @@ -0,0 +1,7 @@ | ||||
| syntax = "proto3"; | ||||
|  | ||||
| package child; | ||||
|  | ||||
| message ChildRequestMessage { | ||||
|     int32 child_argument = 1; | ||||
| } | ||||
| @@ -1,11 +1,14 @@ | ||||
| syntax = "proto3"; | ||||
|  | ||||
| import "request_message.proto"; | ||||
| import "child_package_request_message.proto"; | ||||
|  | ||||
| // Tests generated service correctly imports the RequestMessage | ||||
|  | ||||
| service Test { | ||||
|     rpc DoThing (RequestMessage) returns (RequestResponse); | ||||
|     rpc DoThing2 (child.ChildRequestMessage) returns (RequestResponse); | ||||
|     rpc DoThing3 (Nested.RequestMessage) returns (RequestResponse); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -13,3 +16,8 @@ message RequestResponse { | ||||
|     int32 value = 1; | ||||
| } | ||||
|  | ||||
| message Nested { | ||||
|     message RequestMessage { | ||||
|         int32 nestedArgument = 1; | ||||
|     } | ||||
| } | ||||
| @@ -1,16 +0,0 @@ | ||||
| import pytest | ||||
|  | ||||
| from betterproto.tests.mocks import MockChannel | ||||
| from betterproto.tests.output_betterproto.import_service_input_message import ( | ||||
|     RequestResponse, | ||||
|     TestStub, | ||||
| ) | ||||
|  | ||||
|  | ||||
| @pytest.mark.xfail(reason="#68 Request Input Messages are not imported for service") | ||||
| @pytest.mark.asyncio | ||||
| async def test_service_correctly_imports_reference_message(): | ||||
|     mock_response = RequestResponse(value=10) | ||||
|     service = TestStub(MockChannel([mock_response])) | ||||
|     response = await service.do_thing() | ||||
|     assert mock_response == response | ||||
| @@ -0,0 +1,31 @@ | ||||
| import pytest | ||||
|  | ||||
| from betterproto.tests.mocks import MockChannel | ||||
| from betterproto.tests.output_betterproto.import_service_input_message import ( | ||||
|     RequestResponse, | ||||
|     TestStub, | ||||
| ) | ||||
|  | ||||
|  | ||||
| @pytest.mark.asyncio | ||||
| async def test_service_correctly_imports_reference_message(): | ||||
|     mock_response = RequestResponse(value=10) | ||||
|     service = TestStub(MockChannel([mock_response])) | ||||
|     response = await service.do_thing(argument=1) | ||||
|     assert mock_response == response | ||||
|  | ||||
|  | ||||
| @pytest.mark.asyncio | ||||
| async def test_service_correctly_imports_reference_message_from_child_package(): | ||||
|     mock_response = RequestResponse(value=10) | ||||
|     service = TestStub(MockChannel([mock_response])) | ||||
|     response = await service.do_thing2(child_argument=1) | ||||
|     assert mock_response == response | ||||
|  | ||||
|  | ||||
| @pytest.mark.asyncio | ||||
| async def test_service_correctly_imports_nested_reference(): | ||||
|     mock_response = RequestResponse(value=10) | ||||
|     service = TestStub(MockChannel([mock_response])) | ||||
|     response = await service.do_thing3(nested_argument=1) | ||||
|     assert mock_response == response | ||||
		Reference in New Issue
	
	Block a user