/ justapi / tests / test_grpc_inspect.py
swadhinbiswas test: add end-to-end integration test suite with gRPC and proto stubs · 7/9/2026
43e015f
13 lines · 509 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
from justapi.app import JustAPIApp
from tests.proto.gen import helloworld_pb2, helloworld_pb2_grpc

class GreeterServicer(helloworld_pb2_grpc.GreeterServicer):
    def SayHello(self, request, context):
        return helloworld_pb2.HelloReply(message="Hello from Python!")

def test_grpc_inspect():
    app = JustAPIApp()
    app.set_grpc_addr("127.0.0.1:50051")
    app.add_grpc_service(GreeterServicer(), helloworld_pb2_grpc.add_GreeterServicer_to_server)
    print("gRPC service registered successfully!")