#68 Service input messages are not imported

This commit is contained in:
boukeversteegh 2020-05-25 18:41:11 +02:00
parent 2f9497e064
commit f25c66777a
5 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,15 @@
syntax = "proto3";
import "request_message.proto";
// Tests generated service correctly imports the RequestMessage
service Test {
rpc DoThing (RequestMessage) returns (RequestResponse);
}
message RequestResponse {
int32 value = 1;
}

View File

@ -0,0 +1,5 @@
syntax = "proto3";
message RequestArgument {
}

View File

@ -0,0 +1,5 @@
syntax = "proto3";
message RequestMessage {
int32 argument = 1;
}

View File

@ -0,0 +1,16 @@
import pytest
from betterproto.tests.mocks import MockChannel
from betterproto.tests.output_betterproto.import_service_input_message.import_service_input_message import (
RequestResponse,
TestStub,
)
@pytest.mark.xfail(reason="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

View File

@ -46,7 +46,12 @@ class TestCases:
test_cases = TestCases( test_cases = TestCases(
path=inputs_path, path=inputs_path,
# test cases for services # test cases for services
services={"googletypes_response", "googletypes_response_embedded", "service"}, services={
"googletypes_response",
"googletypes_response_embedded",
"service",
"import_service_input_message_dependency",
},
xfail=xfail.tests, xfail=xfail.tests,
) )