betty.test_utils.attr module¶
Test utilities for betty.attr
.
- class betty.test_utils.attr.AttrTestBase[source]¶
Bases:
Generic
[_InstanceT
,_ValueT
]A base class for testing
betty.attr.Attr
implementations.- get_instances() tuple[Sequence[_InstanceT], str] [source]¶
Get instances with an attribute under test.
- Returns:
A 2-tuple with the instances, and the name of the attribute containing the
betty.attr.Attr
under test.
- test_get_attr() None [source]¶
Tests
betty.attr.Attr.get_attr()
implementations.
- class betty.test_utils.attr.MutableAttrTestBase[source]¶
Bases:
Generic
[_InstanceT
,_ValueT
,_SetT
],AttrTestBase
[_InstanceT
,_ValueT
]A base class for testing
betty.attr.MutableAttr
implementations.- assert_eq(get_value: _ValueT, set_value: _SetT) None [source]¶
Assert that a get value and a set value are equal.
- assert_ne(get_value: _ValueT, set_value: _SetT) None [source]¶
Assert that a get value and a set value are not equal.
- get_instances() tuple[Sequence[_InstanceT], str] [source]¶
Get instances with an attribute under test.
- Returns:
A 2-tuple with the instances, and the name of the attribute containing the
betty.attr.Attr
under test.
- get_mutable_instances() tuple[Sequence[tuple[_InstanceT, Sequence[_SetT]]], str] [source]¶
Get instances with a mutable attribute under test.
- Returns:
A 2-tuple with the instances, and the name of the attribute containing the
betty.attr.MutableAttr
under test.
- test_del_attr() None [source]¶
Tests
betty.attr.MutableAttr.del_attr()
implementations.
- test_new_attr() None [source]¶
Tests
betty.attr.MutableAttr.del_attr()
implementations.
- test_set_attr() None [source]¶
Tests
betty.attr.MutableAttr.set_attr()
implementations.