Public Member Functions | |
def | call_at (self, behavior, time) |
def | call_in (self, behavior, delay) |
def | sleep_for (self, duration) |
def | sleep_until (self, time) |
def | time (self) |
A simulation of time. Implementations needn't be connected with real time as provided by the Python interpreter, but as long as systems under test use RpcContext.is_active and RpcContext.time_remaining for querying RPC liveness implementations may be used to change passage of time in tests.
Definition at line 567 of file src/python/grpcio_testing/grpc_testing/__init__.py.
def grpc_testing.Time.call_at | ( | self, | |
behavior, | |||
time | |||
) |
Adds a behavior to be called at a specific time. Args: behavior: A behavior to be called with no arguments. time: The test time at which to call the behavior. Returns: A grpc.Future with which the call of the behavior may be cancelled before it is executed.
Reimplemented in grpc_testing._time.StrictFakeTime, and grpc_testing._time.StrictRealTime.
Definition at line 600 of file src/python/grpcio_testing/grpc_testing/__init__.py.
def grpc_testing.Time.call_in | ( | self, | |
behavior, | |||
delay | |||
) |
Adds a behavior to be called after some time. Args: behavior: A behavior to be called with no arguments. delay: A duration of time in seconds after which to call the behavior. Returns: A grpc.Future with which the call of the behavior may be cancelled before it is executed.
Reimplemented in grpc_testing._time.StrictFakeTime, and grpc_testing._time.StrictRealTime.
Definition at line 586 of file src/python/grpcio_testing/grpc_testing/__init__.py.
def grpc_testing.Time.sleep_for | ( | self, | |
duration | |||
) |
Blocks for some length of test time. Args: duration: A duration of test time in seconds for which to block.
Reimplemented in grpc_testing._time.StrictFakeTime, and grpc_testing._time.StrictRealTime.
Definition at line 614 of file src/python/grpcio_testing/grpc_testing/__init__.py.
def grpc_testing.Time.sleep_until | ( | self, | |
time | |||
) |
Blocks until some test time. Args: time: The test time until which to block.
Reimplemented in grpc_testing._time.StrictFakeTime, and grpc_testing._time.StrictRealTime.
Definition at line 623 of file src/python/grpcio_testing/grpc_testing/__init__.py.
def grpc_testing.Time.time | ( | self | ) |
Accesses the current test time. Returns: The current test time (over which this object has authority).
Reimplemented in grpc_testing._time.StrictFakeTime, and grpc_testing._time.StrictRealTime.
Definition at line 577 of file src/python/grpcio_testing/grpc_testing/__init__.py.