Namespaces | Classes | Functions
grpc_testing Namespace Reference

Namespaces

 _channel
 
 _common
 
 _server
 
 _time
 

Classes

class  Channel
 
class  Server
 
class  StreamStreamChannelRpc
 
class  StreamStreamServerRpc
 
class  StreamUnaryChannelRpc
 
class  StreamUnaryServerRpc
 
class  Time
 
class  UnaryStreamChannelRpc
 
class  UnaryStreamServerRpc
 
class  UnaryUnaryChannelRpc
 
class  UnaryUnaryServerRpc
 

Functions

def channel (service_descriptors, time)
 
def server_from_dictionary (descriptors_to_servicers, time)
 
def strict_fake_time (now)
 
def strict_real_time ()
 

Function Documentation

◆ channel()

def grpc_testing.channel (   service_descriptors,
  time 
)
Creates a Channel for use in tests of a gRPC Python-using system.

Args:
  service_descriptors: An iterable of descriptor.ServiceDescriptors
    describing the RPCs that will be made on the returned Channel by the
    system under test.
  time: A Time to be used for tests.

Returns:
  A Channel for use in tests.

Definition at line 666 of file src/python/grpcio_testing/grpc_testing/__init__.py.

◆ server_from_dictionary()

def grpc_testing.server_from_dictionary (   descriptors_to_servicers,
  time 
)
Creates a Server for use in tests of a gRPC Python-using system.

Args:
  descriptors_to_servicers: A dictionary from descriptor.ServiceDescriptors
    defining RPC services to servicer objects (usually instances of classes
    that implement "Servicer" interfaces defined in generated "_pb2_grpc"
    modules) implementing those services.
  time: A Time to be used for tests.

Returns:
  A Server for use in tests.

Definition at line 682 of file src/python/grpcio_testing/grpc_testing/__init__.py.

◆ strict_fake_time()

def grpc_testing.strict_fake_time (   now)
Creates a Time that can be manipulated by test code.

The returned instance maintains an internal representation of time
independent of real time. This internal representation only advances
when user code calls the instance's sleep_for and sleep_until methods.

The returned instance will be "strict" with respect to callbacks
submitted to it: it will ensure that all callbacks registered to
be called at time t have been called before it describes the time
as having advanced beyond t.

Returns:
  A Time that simulates the passage of time.

Definition at line 647 of file src/python/grpcio_testing/grpc_testing/__init__.py.

◆ strict_real_time()

def grpc_testing.strict_real_time ( )
Creates a Time backed by the Python interpreter's time.

The returned instance will be "strict" with respect to callbacks
submitted to it: it will ensure that all callbacks registered to
be called at time t have been called before it describes the time
as having advanced beyond t.

Returns:
  A Time backed by the "system" (Python interpreter's) time.

Definition at line 632 of file src/python/grpcio_testing/grpc_testing/__init__.py.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:40