MCPcopy
hub / github.com/python-attrs/attrs / test_fail_invalid_mapping

Method test_fail_invalid_mapping

tests/test_validators.py:710–720  ·  view source on GitHub ↗

Raise `TypeError` if mapping validator fails.

(self)

Source from the content-addressed store, hash-verified

708 assert value == e.value.value
709
710 def test_fail_invalid_mapping(self):
711 """
712 Raise `TypeError` if mapping validator fails.
713 """
714 key_validator = instance_of(str)
715 value_validator = instance_of(int)
716 mapping_validator = instance_of(dict)
717 v = deep_mapping(key_validator, value_validator, mapping_validator)
718 a = simple_attr("test")
719 with pytest.raises(TypeError):
720 v(None, a, None)
721
722 def test_fail_invalid_key(self):
723 """

Callers

nothing calls this directly

Calls 3

instance_ofFunction · 0.90
deep_mappingFunction · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected