Let's say I have a simple proto:
service HelloService {
rpc SayHello(HelloReq) returns (HelloResp) {};
}
message HelloReq {
string Name = 1;
}
message HelloResp {
string Result = 1;
}
and my SayHello is implemented like:
class HelloServicer(hello_pb2_grpc.HelloServiceServicer):
def SayHello(self, request, context):
if len(request.Name) >= 10:
msg = 'Length of `Name` cannot be more than 10 characters'
context.set_details(msg)
context.set_code(grpc.StatusCode.INVALID_ARGUMENT)
return hello_pb2.HelloResp()
return hello_pb2.HelloResp(Result="Hey, {}!".format(request.Name))
Can anyone tell me how do I write tests for my server? I checked this repo
-
https://github.com/grpc/grpc/tree/master/src/python/grpcio_tests/tests/testing
or the docs here - https://grpc.io/grpc/python/grpc_testing.html but I
couldn't understand anything at all.
I really appreciate some help, thank you!
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/c313a922-3f94-4bdb-9324-fb419b7d2c12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.