Exemple #1
0
    def test_should_raise_error_when_giving_incorrect_value_to_hex_property(
            self, value):
        part = FieldPart('flags', 0b010, 3)
        with pytest.raises(TypeError) as exc_info:
            part.hex = value

        assert f'hex value must be a boolean but you provided {value}' == str(
            exc_info.value)
Exemple #2
0
 def test_should_set_hex_property_when_giving_correct_value(self):
     part = FieldPart('flags', 0b010, 3)
     part.hex = True
     assert part.hex