test_typed_key_dict

Module Contents

Classes

Interface

ConcreteA

ConcreteB

Key

A key that contains type information about the value.

TKDictFixture

Functions

test_tkdict_get_set(→ None)

Tests that __getitem__ and __setitem__ work properly.

test_tkdict_get_wrong_type(→ None)

Check that using a key that hashes to the same value but has a different

test_tkdict_in_len()

Check that __contains__ and __len__ works.

test_tkdict_del_len()

Check that __del__ works.

test_tkdict_keys_values_items()

Checks that .keys(), .values() and .items() work as expected.

class test_typed_key_dict.Interface(name: str)
__eq__(other) bool

Return self==value.

class test_typed_key_dict.ConcreteA(name: str)

Bases: Interface

class test_typed_key_dict.ConcreteB(name: str)

Bases: Interface

class test_typed_key_dict.Key(str_val: str, cls: Type[stp.utils.typed_key_dict.ValueConcreteT])

Bases: stp.utils.typed_key_dict.TypedKey[stp.utils.typed_key_dict.ValueConcreteT]

A key that contains type information about the value.

__eq__(other) bool

Return self==value.

__hash__() int

Return hash(self).

class test_typed_key_dict.TKDictFixture
test_typed_key_dict.test_tkdict_get_set() None

Tests that __getitem__ and __setitem__ work properly.

test_typed_key_dict.test_tkdict_get_wrong_type() None

Check that using a key that hashes to the same value but has a different concrete type results in an exception.

test_typed_key_dict.test_tkdict_in_len()

Check that __contains__ and __len__ works.

test_typed_key_dict.test_tkdict_del_len()

Check that __del__ works.

test_typed_key_dict.test_tkdict_keys_values_items()

Checks that .keys(), .values() and .items() work as expected.