#68 Service input messages are not imported
This commit is contained in:
parent
2f9497e064
commit
f25c66777a
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
message RequestArgument {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
message RequestMessage {
|
||||||
|
int32 argument = 1;
|
||||||
|
}
|
@ -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
|
@ -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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user