cis_interface.serialize.tests package

Submodules

cis_interface.serialize.tests.test_AsciiMapSerialize module

class cis_interface.serialize.tests.test_AsciiMapSerialize.TestAsciiMapSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for TestAsciiMapSerialize class.

test_error_delim()[source]

Test error for message with too many delimiters on a line.

test_error_nonstrval()[source]

Test error on serializing dictionary with non-string values.

test_remove_quotes()[source]

Test deserialization of message with single quotes.

cis_interface.serialize.tests.test_AsciiTableSerialize module

class cis_interface.serialize.tests.test_AsciiTableSerialize.TestAsciiTableSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for AsciiTableSerialize class.

attr_list = (['datatype', 'typedef', 'numpy_dtype'], ['format_str', 'field_names', 'field_units', 'as_array'])
test_field_specs()[source]

Test field specifiers.

class cis_interface.serialize.tests.test_AsciiTableSerialize.TestAsciiTableSerializeSingle(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for AsciiTableSerialize class.

get_options()[source]

Get testing options.

class cis_interface.serialize.tests.test_AsciiTableSerialize.TestAsciiTableSerialize_asarray(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_AsciiTableSerialize.TestAsciiTableSerialize

Test class for AsciiTableSerialize class with as_array.

testing_option_kws = {'as_array': True}
cis_interface.serialize.tests.test_AsciiTableSerialize.test_deserialize_nofmt()[source]

Test error on deserialization without a format.

cis_interface.serialize.tests.test_AsciiTableSerialize.test_serialize_nofmt()[source]

Test error on serialization without a format.

cis_interface.serialize.tests.test_DefaultSerialize module

class cis_interface.serialize.tests.test_DefaultSerialize.FakeSerializer(func_serialize=None, func_deserialize=None, encode_func_serialize=None, decode_func_deserialize=None, func_typedef=None, **kwargs)[source]

Bases: cis_interface.serialize.DefaultSerialize.DefaultSerialize

func_deserialize(args)[source]

Method that deserializes using eval.

func_serialize(args)[source]

Method that serializes using repr.

class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize(*args, **kwargs)[source]

Bases: cis_interface.tests.CisTestClassInfo

Test class for DefaultSerialize class.

assert_result_equal(x, y)[source]

Assert that serialized/deserialized objects equal.

attr_list = ['datatype', 'typedef', 'numpy_dtype']
empty_head(msg)[source]

dict: Empty header for message only contains the size.

inst_kwargs

Keyword arguments for creating the test instance.

map_sent2recv(obj)[source]

Convert a sent object into a received one.

mod

Module for class to be tested.

test_deserialize_empty()[source]

Test call for empty string.

test_deserialize_error()[source]

Test error when deserializing message that is not bytes.

test_field_specs()[source]

Test field specifiers.

test_invalid_update()[source]

Test error raised when serializer updated with type that isn’t compatible.

test_serialize()[source]

Test serialize/deserialize.

test_serialize_eof()[source]

Test serialize/deserialize EOF.

test_serialize_eof_header()[source]

Test serialize/deserialize EOF with header.

test_serialize_header()[source]

Test serialize/deserialize with header.

test_serialize_no_format()[source]

Test serialize/deserialize without format string.

test_serialize_no_metadata()[source]

Test serializing without metadata.

test_serialize_sinfo()[source]

Test serialize/deserialize with serializer info.

class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_alias(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_format

Test class for DefaultSerialize class with alias.

setup(*args, **kwargs)[source]

Create an instance of the class.

class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_array(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_format

Test class for DefaultSerialize class with format as array.

testing_option_kws = {'as_array': True, 'as_format': True}
class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_class(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_func

Test class for DefaultSerialize class with classes.

get_options()[source]

Get testing options.

class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_format(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for DefaultSerialize class with format.

testing_option_kws = {'as_format': True}
class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_func(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for DefaultSerialize class with functions.

get_options()[source]

Get testing options.

testing_option_kws = {'as_format': True}
class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_func_error(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_func

Test class for DefaultSerialize class with incorrect functions.

test_field_specs()[source]

Disabled: Test field specifiers.

test_serialize()[source]

Test serialize with function that dosn’t return correct type.

test_serialize_header()[source]

Disabled: Test serialize/deserialize with header.

test_serialize_no_metadata()[source]

Test serializing without metadata.

test_serialize_sinfo()[source]

Disabled: Test serialize/deserialize with serializer info.

class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_type(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for DefaultSerialize class with types.

get_options()[source]

Get testing options.

class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_uniform(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for items as dictionary.

get_options()[source]

Get testing options.

class cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_uniform_names(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize_uniform

Test class for items as dictionary.

get_options()[source]

Get testing options.

cis_interface.serialize.tests.test_DefaultSerialize.test_demote_string()[source]

Test format str creation of typedef.

cis_interface.serialize.tests.test_JSONSerialize module

class cis_interface.serialize.tests.test_JSONSerialize.TestJSONSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for TestJSONSerialize class.

cis_interface.serialize.tests.test_MatSerialize module

class cis_interface.serialize.tests.test_MatSerialize.TestMatSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for TestMatSerialize class.

test_serialize_errors()[source]

Test serialize errors.

cis_interface.serialize.tests.test_ObjSerialize module

class cis_interface.serialize.tests.test_ObjSerialize.TestObjSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_PlySerialize.TestPlySerialize

Test class for TestObjSerialize class.

cis_interface.serialize.tests.test_PandasSerialize module

class cis_interface.serialize.tests.test_PandasSerialize.TestPandasSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_AsciiTableSerialize.TestAsciiTableSerialize

Test class for TestPandasSerialize class.

test_apply_field_names_errors()[source]

Test errors raised by apply_field_names.

test_func_serialize_errors()[source]

Test errors raised by func_serialize.

cis_interface.serialize.tests.test_PickleSerialize module

class cis_interface.serialize.tests.test_PickleSerialize.TestPickleSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for TestPickleSerialize class.

cis_interface.serialize.tests.test_PlySerialize module

class cis_interface.serialize.tests.test_PlySerialize.TestPlySerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for TestPlySerialize class.

cis_interface.serialize.tests.test_YAMLSerialize module

class cis_interface.serialize.tests.test_YAMLSerialize.TestYAMLSerialize(*args, **kwargs)[source]

Bases: cis_interface.serialize.tests.test_DefaultSerialize.TestDefaultSerialize

Test class for TestYAMLSerialize class.

cis_interface.serialize.tests.test_serialize module

cis_interface.serialize.tests.test_serialize.test_array_to_bytes()[source]

Test conversion of arrays to bytes and back.

cis_interface.serialize.tests.test_serialize.test_array_to_table()[source]

Test conversion of arrays to ASCII table and back.

cis_interface.serialize.tests.test_serialize.test_cformat2nptype()[source]

Test conversion from C format string to numpy dtype.

cis_interface.serialize.tests.test_serialize.test_cformat2nptype_structured()[source]

Test conversion from C format string to numpy dtype for structured data types.

cis_interface.serialize.tests.test_serialize.test_cformat2pyscanf()[source]

Test conversion of C format string to version for python scanf.

cis_interface.serialize.tests.test_serialize.test_combine_eles()[source]

Test combine_eles.

cis_interface.serialize.tests.test_serialize.test_combine_flds()[source]

Test combine_flds.

cis_interface.serialize.tests.test_serialize.test_consolidate_array()[source]

Test consolidation of array information in different forms.

cis_interface.serialize.tests.test_serialize.test_dict2list()[source]

Test conversion of a dictionary to a list and back.

cis_interface.serialize.tests.test_serialize.test_extract_formats()[source]

Test extract_formats.

cis_interface.serialize.tests.test_serialize.test_format2table()[source]

Test getting table information from a format string.

cis_interface.serialize.tests.test_serialize.test_format_header()[source]

Test formatting header.

cis_interface.serialize.tests.test_serialize.test_format_message()[source]

Test formatting message from a list or arguments and back.

cis_interface.serialize.tests.test_serialize.test_get_registered_serializers()[source]

Test get_registered_serializers.

cis_interface.serialize.tests.test_serialize.test_get_serializer_class_errors()[source]

Test errors in get_serializer_class for invalid serializer.

cis_interface.serialize.tests.test_serialize.test_nptype2cformat()[source]

Test conversion from numpy dtype to C format string.

cis_interface.serialize.tests.test_serialize.test_nptype2cformat_structured()[source]

Test conversion from structured numpy dtype to C format string.

cis_interface.serialize.tests.test_serialize.test_numpy2dict()[source]

Test conversion of a numpy array to a dictionary and back.

cis_interface.serialize.tests.test_serialize.test_numpy2list()[source]

Test conversion of a numpy array to a list and back.

cis_interface.serialize.tests.test_serialize.test_numpy2pandas()[source]

Test conversion of a numpy array to a pandas data frame and back.

cis_interface.serialize.tests.test_serialize.test_pandas2dict()[source]

Test conversion of a Pandas data frame to a dictionary and back.

cis_interface.serialize.tests.test_serialize.test_parse_header()[source]

Test parsing header.

cis_interface.serialize.tests.test_serialize.test_register_serializer_errors()[source]

Test errors in register_serializer for duplicate.

Module contents