If iterables are passed as validators, they are combined with and_.
(self, conv)
| 790 | |
| 791 | @pytest.mark.parametrize("conv", [list, tuple]) |
| 792 | def test_validators_iterables(self, conv): |
| 793 | """ |
| 794 | If iterables are passed as validators, they are combined with and_. |
| 795 | """ |
| 796 | key_validator = (instance_of(str), min_len(2)) |
| 797 | value_validator = (instance_of(int), ge(10)) |
| 798 | mapping_validator = (instance_of(dict), max_len(2)) |
| 799 | |
| 800 | v = deep_mapping( |
| 801 | conv(key_validator), |
| 802 | conv(value_validator), |
| 803 | conv(mapping_validator), |
| 804 | ) |
| 805 | |
| 806 | assert and_(*key_validator) == v.key_validator |
| 807 | assert and_(*value_validator) == v.value_validator |
| 808 | assert and_(*mapping_validator) == v.mapping_validator |
| 809 | |
| 810 | |
| 811 | class TestIsCallable: |
nothing calls this directly
no test coverage detected