Allows to install mocks that are reset between tests, see grpc_mockserver.
Definition at line 127 of file __init__.py.
Public Member Functions | |
| None | __init__ (self, *, MockserverSession mockserver_session, bool experimental=False) |
| MockDecorator | __call__ (self, servicer_method) |
| Returns a decorator to mock the specified gRPC service method implementation. | |
| Callable[[str], MockDecorator] | mock_factory (self, servicer_class) |
| Allows to create a fixture as a shorthand for mocking methods of the specified gRPC service. | |
Protected Attributes | |
| _mockserver_session = mockserver_session | |
| None pytest_userver.grpc.Mockserver.__init__ | ( | self, | |
| * | , | ||
| MockserverSession | mockserver_session, | ||
| bool | experimental = False ) |
Initializes Mockserver.
Mockserver is usually obtained from grpc_mockserver. Definition at line 133 of file __init__.py.
| MockDecorator pytest_userver.grpc.Mockserver.__call__ | ( | self, | |
| servicer_method ) |
Returns a decorator to mock the specified gRPC service method implementation.
Example:
Definition at line 146 of file __init__.py.
| Callable[[str], MockDecorator] pytest_userver.grpc.Mockserver.mock_factory | ( | self, | |
| servicer_class ) |
Allows to create a fixture as a shorthand for mocking methods of the specified gRPC service.
Example:
Definition at line 159 of file __init__.py.
|
protected |
Definition at line 144 of file __init__.py.