Closed shawnbrown closed 3 years ago
Validation is mishandled when data is a squint query-mapping and requirement is a non-mapping object.
squint
import datatest import squint select = squint.Select([ ['A', 'B'], ['x', 'foo'], ['x', 'bar'], ['y', 'foo'], ['y', 'bar'], ]) selection = select({'A': 'B'}) # <- Query returns a mapping. datatest.validate(selection, str) # <- Requirement is a non-mapping object.
The example above should pass but it fails with the following error:
$ python example.py Traceback (most recent call last): File "example.py", line 13, in <module> datatest.validate(selection, str) datatest.ValidationError: does not satisfy 'str' (2 differences): [ Invalid(('x', <Result object (evaltype=list) at 0x7fd43beb>)), Invalid(('y', <Result object (evaltype=list) at 0x7fd43bed>)), ]
Validation is mishandled when data is a
squint
query-mapping and requirement is a non-mapping object.The example above should pass but it fails with the following error: