DCCL v5
Loading...
Searching...
No Matches
test_dccl Namespace Reference

Classes

class  TestDecodeWithFullNameNormalMsg
 
class  TestDecodeWithFullNameOmitId
 
class  TestEncodeDecodeNormalMsg
 
class  TestMiscCodecMethods
 

Functions

 _load_proto_and_pb2 ()
 
 _make_codec ()
 

Variables

 _this_dir = os.path.dirname(os.path.abspath(__file__))
 
 PROTO_PATH = os.environ.get("DCCL_TEST_PROTO_PATH", _this_dir)
 
 INC_PATH = os.environ.get("DCCL_INC_PATH", "")
 
 _pb2 = _load_proto_and_pb2()
 

Detailed Description

Unit tests for the DCCL Python bindings.

These tests cover:
  - Basic encode/decode round-trip for a message with an ID field.
  - decode_with_full_name for a normal (ID-bearing) message.
  - decode_with_full_name for a message with omit_id=true.
  - Error cases: unknown type, mismatched type.

The tests require the following environment variables (set by CMake):
  DCCL_TEST_PROTO_PATH  - directory containing test.proto
  DCCL_INC_PATH         - directory containing dccl/option_extensions.proto

Function Documentation

◆ _load_proto_and_pb2()

test_dccl._load_proto_and_pb2 ( )
protected
Load test.proto into DCCL's DynamicProtobufManager and import the
generated *_pb2 module.  Returns the pb2 module.

Definition at line 53 of file test_dccl.py.

◆ _make_codec()

test_dccl._make_codec ( )
protected
Return a freshly constructed dccl.Codec with all test types loaded.

Definition at line 73 of file test_dccl.py.

Variable Documentation

◆ _pb2

test_dccl._pb2 = _load_proto_and_pb2()
protected

Definition at line 70 of file test_dccl.py.

◆ _this_dir

test_dccl._this_dir = os.path.dirname(os.path.abspath(__file__))
protected

Definition at line 48 of file test_dccl.py.

◆ INC_PATH

test_dccl.INC_PATH = os.environ.get("DCCL_INC_PATH", "")

Definition at line 50 of file test_dccl.py.

◆ PROTO_PATH

test_dccl.PROTO_PATH = os.environ.get("DCCL_TEST_PROTO_PATH", _this_dir)

Definition at line 49 of file test_dccl.py.