userver: pytest_userver.plugins.grpc.client Namespace Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
pytest_userver.plugins.grpc.client Namespace Reference

Detailed Description

Make gRPC requests to the service.

See also
gRPC client and service

Classes

class  _AsyncExcClientInterceptor
 
class  _GenericClientInterceptor
 

Functions

Optional[int] grpc_service_port (service_config)
 Returns the gRPC listener port number of the service that is set in the static configuration file.
 
int grpc_service_port_fallback ()
 Returns the gRPC port that should be used in service runner mode in case no port is specified in the source config_yaml.
 
str grpc_service_endpoint (service_config, grpc_service_port)
 Returns the gRPC endpoint of the service.
 
float grpc_service_timeout (pytestconfig)
 Returns the gRPC timeout for the service that is set by the command line option --service-timeout.
 
Callable[[grpc.aio.ClientCallDetails, MessageOrStream], Awaitable[None]] grpc_client_prepare (service_client, asyncexc_check)
 Returns the function that will be called in before each gRPC request, client-side.
 
 grpc_session_channel (grpc_service_endpoint, _grpc_channel_interceptor, _grpc_channel_interceptor_asyncexc)
 
 grpc_channel (service_client, grpc_service_endpoint, grpc_service_timeout, grpc_session_channel, _grpc_channel_interceptor, grpc_client_prepare, _grpc_channel_interceptor_asyncexc, asyncexc_check)
 Returns the gRPC channel configured by the parameters from the grpc_service_endpoint fixture.
 
Optional[pathlib.Path] grpc_socket_path ()
 Path for the UNIX socket over which testsuite will talk to the gRPC service, if it chooses to use a UNIX socket.
 
 userver_config_grpc_endpoint (pytestconfig, grpc_service_port_fallback, substitute_config_vars, request, choose_free_port)
 Returns a function that adjusts the static config for testsuite.
 
_GenericClientInterceptor _grpc_channel_interceptor (daemon_scoped_mark)
 
_AsyncExcClientInterceptor _grpc_channel_interceptor_asyncexc ()
 

Variables

float DEFAULT_TIMEOUT = 15.0
 
list USERVER_CONFIG_HOOKS = ['userver_config_grpc_endpoint']
 
 MessageOrStream = Union[google.protobuf.message.Message, AsyncIterable[google.protobuf.message.Message]]
 
 _AsyncExcCheck = Callable[[], None]
 

Function Documentation

◆ _grpc_channel_interceptor()

_GenericClientInterceptor pytest_userver.plugins.grpc.client._grpc_channel_interceptor ( daemon_scoped_mark)
protected

Definition at line 247 of file client.py.

◆ _grpc_channel_interceptor_asyncexc()

_AsyncExcClientInterceptor pytest_userver.plugins.grpc.client._grpc_channel_interceptor_asyncexc ( )
protected

Definition at line 269 of file client.py.

◆ grpc_session_channel()

pytest_userver.plugins.grpc.client.grpc_session_channel ( grpc_service_endpoint,
_grpc_channel_interceptor,
_grpc_channel_interceptor_asyncexc )

Definition at line 114 of file client.py.

Variable Documentation

◆ _AsyncExcCheck

pytest_userver.plugins.grpc.client._AsyncExcCheck = Callable[[], None]
protected

Definition at line 25 of file client.py.

◆ DEFAULT_TIMEOUT

float pytest_userver.plugins.grpc.client.DEFAULT_TIMEOUT = 15.0

Definition at line 21 of file client.py.

◆ MessageOrStream

pytest_userver.plugins.grpc.client.MessageOrStream = Union[google.protobuf.message.Message, AsyncIterable[google.protobuf.message.Message]]

Definition at line 24 of file client.py.

◆ USERVER_CONFIG_HOOKS

list pytest_userver.plugins.grpc.client.USERVER_CONFIG_HOOKS = ['userver_config_grpc_endpoint']

Definition at line 22 of file client.py.