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

Classes

class  _GenericHandler
 
class  _MethodHandler
 
class  CompressionTest
 

Functions

def _get_byte_counts (channel_kwargs, multicallable_kwargs, client_function, server_kwargs, server_handler, message)
 
def _get_compression_ratios (client_function, first_channel_kwargs, first_multicallable_kwargs, first_server_kwargs, first_server_handler, second_channel_kwargs, second_multicallable_kwargs, second_server_kwargs, second_server_handler, message)
 
def _get_compression_str (name, value)
 
def _get_compression_test_name (client_streaming, server_streaming, channel_compression, multicallable_compression, server_compression, server_call_compression)
 
def _instrumented_client_server_pair (channel_kwargs, server_kwargs, server_handler)
 
def _make_handle_stream_stream (pre_response_callback)
 
def _make_handle_stream_unary (pre_response_callback)
 
def _make_handle_unary_stream (pre_response_callback)
 
def _make_handle_unary_unary (pre_response_callback)
 
def _stream_stream_client (channel, multicallable_kwargs, message)
 
def _stream_unary_client (channel, multicallable_kwargs, message)
 
def _test_options ()
 
def _unary_stream_client (channel, multicallable_kwargs, message)
 
def _unary_unary_client (channel, multicallable_kwargs, message)
 
def disable_first_compression (request, servicer_context)
 
def disable_next_compression (request, servicer_context)
 
def set_call_compression (compression_method, request_or_iterator, servicer_context)
 
def test_compression (**kwargs)
 

Variables

tuple _COMPRESSION_METHODS
 
dictionary _COMPRESSION_NAMES
 
float _COMPRESSION_RATIO_THRESHOLD = 0.05
 
string _HOST = 'localhost'
 
string _REQUEST = b'\x00' * 100
 
int _STREAM_LENGTH = test_constants.STREAM_LENGTH // 16
 
string _STREAM_STREAM = '/test/StreamStream'
 
string _STREAM_UNARY = '/test/StreamUnary'
 
dictionary _TEST_OPTIONS
 
string _UNARY_STREAM = '/test/UnaryStream'
 
string _UNARY_UNARY = '/test/UnaryUnary'
 
 verbosity
 

Function Documentation

◆ _get_byte_counts()

def tests.unit._compression_test._get_byte_counts (   channel_kwargs,
  multicallable_kwargs,
  client_function,
  server_kwargs,
  server_handler,
  message 
)
private

Definition at line 189 of file _compression_test.py.

◆ _get_compression_ratios()

def tests.unit._compression_test._get_compression_ratios (   client_function,
  first_channel_kwargs,
  first_multicallable_kwargs,
  first_server_kwargs,
  first_server_handler,
  second_channel_kwargs,
  second_multicallable_kwargs,
  second_server_kwargs,
  second_server_handler,
  message 
)
private

Definition at line 198 of file _compression_test.py.

◆ _get_compression_str()

def tests.unit._compression_test._get_compression_str (   name,
  value 
)
private

Definition at line 320 of file _compression_test.py.

◆ _get_compression_test_name()

def tests.unit._compression_test._get_compression_test_name (   client_streaming,
  server_streaming,
  channel_compression,
  multicallable_compression,
  server_compression,
  server_call_compression 
)
private

Definition at line 324 of file _compression_test.py.

◆ _instrumented_client_server_pair()

def tests.unit._compression_test._instrumented_client_server_pair (   channel_kwargs,
  server_kwargs,
  server_handler 
)
private

Definition at line 173 of file _compression_test.py.

◆ _make_handle_stream_stream()

def tests.unit._compression_test._make_handle_stream_stream (   pre_response_callback)
private

Definition at line 101 of file _compression_test.py.

◆ _make_handle_stream_unary()

def tests.unit._compression_test._make_handle_stream_unary (   pre_response_callback)
private

Definition at line 87 of file _compression_test.py.

◆ _make_handle_unary_stream()

def tests.unit._compression_test._make_handle_unary_stream (   pre_response_callback)
private

Definition at line 76 of file _compression_test.py.

◆ _make_handle_unary_unary()

def tests.unit._compression_test._make_handle_unary_unary (   pre_response_callback)
private

Definition at line 66 of file _compression_test.py.

◆ _stream_stream_client()

def tests.unit._compression_test._stream_stream_client (   channel,
  multicallable_kwargs,
  message 
)
private

Definition at line 240 of file _compression_test.py.

◆ _stream_unary_client()

def tests.unit._compression_test._stream_unary_client (   channel,
  multicallable_kwargs,
  message 
)
private

Definition at line 231 of file _compression_test.py.

◆ _test_options()

def tests.unit._compression_test._test_options ( )
private

Definition at line 343 of file _compression_test.py.

◆ _unary_stream_client()

def tests.unit._compression_test._unary_stream_client (   channel,
  multicallable_kwargs,
  message 
)
private

Definition at line 222 of file _compression_test.py.

◆ _unary_unary_client()

def tests.unit._compression_test._unary_unary_client (   channel,
  multicallable_kwargs,
  message 
)
private

Definition at line 214 of file _compression_test.py.

◆ disable_first_compression()

def tests.unit._compression_test.disable_first_compression (   request,
  servicer_context 
)

Definition at line 125 of file _compression_test.py.

◆ disable_next_compression()

def tests.unit._compression_test.disable_next_compression (   request,
  servicer_context 
)

Definition at line 120 of file _compression_test.py.

◆ set_call_compression()

def tests.unit._compression_test.set_call_compression (   compression_method,
  request_or_iterator,
  servicer_context 
)

Definition at line 114 of file _compression_test.py.

◆ test_compression()

def tests.unit._compression_test.test_compression ( **  kwargs)

Definition at line 350 of file _compression_test.py.

Variable Documentation

◆ _COMPRESSION_METHODS

tuple tests.unit._compression_test._COMPRESSION_METHODS
private
Initial value:
1 = (
2  None,
3  # Disabled for test tractability.
4  # grpc.Compression.NoCompression,
5  # grpc.Compression.Deflate,
6  grpc.Compression.Gzip,
7 )

Definition at line 42 of file _compression_test.py.

◆ _COMPRESSION_NAMES

dictionary tests.unit._compression_test._COMPRESSION_NAMES
private
Initial value:
1 = {
2  None: 'Uncompressed',
3  grpc.Compression.NoCompression: 'NoCompression',
4  grpc.Compression.Deflate: 'DeflateCompression',
5  grpc.Compression.Gzip: 'GzipCompression',
6 }

Definition at line 49 of file _compression_test.py.

◆ _COMPRESSION_RATIO_THRESHOLD

float tests.unit._compression_test._COMPRESSION_RATIO_THRESHOLD = 0.05
private

Definition at line 41 of file _compression_test.py.

◆ _HOST

string tests.unit._compression_test._HOST = 'localhost'
private

Definition at line 38 of file _compression_test.py.

◆ _REQUEST

string tests.unit._compression_test._REQUEST = b'\x00' * 100
private

Definition at line 40 of file _compression_test.py.

◆ _STREAM_LENGTH

int tests.unit._compression_test._STREAM_LENGTH = test_constants.STREAM_LENGTH // 16
private

Definition at line 36 of file _compression_test.py.

◆ _STREAM_STREAM

string tests.unit._compression_test._STREAM_STREAM = '/test/StreamStream'
private

Definition at line 33 of file _compression_test.py.

◆ _STREAM_UNARY

string tests.unit._compression_test._STREAM_UNARY = '/test/StreamUnary'
private

Definition at line 32 of file _compression_test.py.

◆ _TEST_OPTIONS

dictionary tests.unit._compression_test._TEST_OPTIONS
private
Initial value:
1 = {
2  'client_streaming': (True, False),
3  'server_streaming': (True, False),
4  'channel_compression': _COMPRESSION_METHODS,
5  'multicallable_compression': _COMPRESSION_METHODS,
6  'server_compression': _COMPRESSION_METHODS,
7  'server_call_compression': _COMPRESSION_METHODS,
8 }

Definition at line 56 of file _compression_test.py.

◆ _UNARY_STREAM

string tests.unit._compression_test._UNARY_STREAM = '/test/UnaryStream'
private

Definition at line 31 of file _compression_test.py.

◆ _UNARY_UNARY

string tests.unit._compression_test._UNARY_UNARY = '/test/UnaryUnary'
private

Definition at line 30 of file _compression_test.py.

◆ verbosity

tests.unit._compression_test.verbosity

Definition at line 362 of file _compression_test.py.



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