userver: pytest_userver.plugins.grpc.mockserver Namespace Reference
Loading...
Searching...
No Matches
pytest_userver.plugins.grpc.mockserver Namespace Reference

Detailed Description

Mocks for the gRPC servers.

See also
gRPC client and service

Classes

class  GrpcServiceMock
 

Functions

str grpc_mockserver_endpoint (pytestconfig, get_free_port)
 Returns the gRPC endpoint to start the mocking server that is set by command line --grpc-mockserver-host and --grpc-mockserver-port options.
 
grpc.aio.Server grpc_mockserver (grpc_mockserver_endpoint)
 Returns the gRPC mocking server.
 
 create_grpc_mock ()
 Creates the gRPC mock server for the provided type.
 
 pytest_addoption (parser)
 
GrpcServiceMock _create_servicer_mock (type servicer_class, *Optional[List[str]] stream_method_names=None, Optional[Callable[..., None]] before_call_hook=None)
 

Variables

int DEFAULT_PORT = 8091
 

Function Documentation

◆ _create_servicer_mock()

GrpcServiceMock pytest_userver.plugins.grpc.mockserver._create_servicer_mock ( type servicer_class,
*Optional[List[str]] stream_method_names = None,
Optional[Callable[..., None]] before_call_hook = None )
protected

Definition at line 123 of file mockserver.py.

◆ pytest_addoption()

pytest_userver.plugins.grpc.mockserver.pytest_addoption ( parser)

Definition at line 108 of file mockserver.py.

Variable Documentation

◆ DEFAULT_PORT

int pytest_userver.plugins.grpc.mockserver.DEFAULT_PORT = 8091

Definition at line 20 of file mockserver.py.