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

Method test_validators_iterables

tests/test_validators.py:645–655  ·  view source on GitHub ↗

If iterables are passed as validators, they are combined with and_.

(self, conv)

Source from the content-addressed store, hash-verified

643
644 @pytest.mark.parametrize("conv", [list, tuple])
645 def test_validators_iterables(self, conv):
646 """
647 If iterables are passed as validators, they are combined with and_.
648 """
649 member_validator = (instance_of(int),)
650 iterable_validator = (instance_of(list), min_len(1))
651
652 v = deep_iterable(conv(member_validator), conv(iterable_validator))
653
654 assert and_(*member_validator) == v.member_validator
655 assert and_(*iterable_validator) == v.iterable_validator
656
657
658class TestDeepMapping:

Callers

nothing calls this directly

Calls 4

instance_ofFunction · 0.90
min_lenFunction · 0.90
deep_iterableFunction · 0.90
and_Function · 0.85

Tested by

no test coverage detected