test_typed_key_dict
¶
Module Contents¶
Classes¶
A key that contains type information about the value. |
|
Functions¶
|
Tests that __getitem__ and __setitem__ work properly. |
|
Check that using a key that hashes to the same value but has a different |
Check that __contains__ and __len__ works. |
|
Check that __del__ works. |
|
Checks that .keys(), .values() and .items() work as expected. |
- 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.