Classes | Functions | Variables
tests.unit.test_common Namespace Reference

Classes

class  WaitGroup
 

Functions

def metadata_transmitted (original_metadata, transmitted_metadata)
 
def running_under_gevent ()
 
def test_secure_channel (target, channel_credentials, server_host_override)
 
def test_server (max_workers=10, reuse_port=False)
 

Variables

string DETAILS = 'test details'
 
tuple INVOCATION_INITIAL_METADATA
 
tuple SERVICE_INITIAL_METADATA
 
tuple SERVICE_TERMINAL_METADATA
 

Function Documentation

◆ metadata_transmitted()

def tests.unit.test_common.metadata_transmitted (   original_metadata,
  transmitted_metadata 
)
Judges whether or not metadata was acceptably transmitted.

  gRPC is allowed to insert key-value pairs into the metadata values given by
  applications and to reorder key-value pairs with different keys but it is not
  allowed to alter existing key-value pairs or to reorder key-value pairs with
  the same key.

  Args:
original_metadata: A metadata value used in a test of gRPC. An iterable over
  iterables of length 2.
transmitted_metadata: A metadata value corresponding to original_metadata
  after having been transmitted via gRPC. An iterable over iterables of
  length 2.

  Returns:
 A boolean indicating whether transmitted_metadata accurately reflects
  original_metadata after having been transmitted via gRPC.

Definition at line 41 of file test_common.py.

◆ running_under_gevent()

def tests.unit.test_common.running_under_gevent ( )

Definition at line 137 of file test_common.py.

◆ test_secure_channel()

def tests.unit.test_common.test_secure_channel (   target,
  channel_credentials,
  server_host_override 
)
Creates an insecure Channel to a remote host.

  Args:
host: The name of the remote host to which to connect.
port: The port of the remote host to which to connect.
channel_credentials: The implementations.ChannelCredentials with which to
  connect.
server_host_override: The target name used for SSL host name checking.

  Returns:
An implementations.Channel to the remote host through which RPCs may be
  conducted.

Definition at line 82 of file test_common.py.

◆ test_server()

def tests.unit.test_common.test_server (   max_workers = 10,
  reuse_port = False 
)
Creates an insecure grpc server.

 These servers have SO_REUSEPORT disabled to prevent cross-talk.

Definition at line 103 of file test_common.py.

Variable Documentation

◆ DETAILS

string tests.unit.test_common.DETAILS = 'test details'

Definition at line 38 of file test_common.py.

◆ INVOCATION_INITIAL_METADATA

tuple tests.unit.test_common.INVOCATION_INITIAL_METADATA
Initial value:
1 = (
2  ('0', 'abc'),
3  ('1', 'def'),
4  ('2', 'ghi'),
5 )

Definition at line 23 of file test_common.py.

◆ SERVICE_INITIAL_METADATA

tuple tests.unit.test_common.SERVICE_INITIAL_METADATA
Initial value:
1 = (
2  ('3', 'jkl'),
3  ('4', 'mno'),
4  ('5', 'pqr'),
5 )

Definition at line 28 of file test_common.py.

◆ SERVICE_TERMINAL_METADATA

tuple tests.unit.test_common.SERVICE_TERMINAL_METADATA
Initial value:
1 = (
2  ('6', 'stu'),
3  ('7', 'vwx'),
4  ('8', 'yza'),
5 )

Definition at line 33 of file test_common.py.



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