CSenshi / Validator

Easy-to-use, Highly Configurable Python Data Validator. Inspired by Laravel Validator
https://pypi.org/project/validator/
MIT License
46 stars 23 forks source link

Add Tests #59

Closed CSenshi closed 4 years ago

CSenshi commented 4 years ago

Currently we are checking rules only on Rule class instances. Therefore we have no ability to check for __from_str__ method. Please add new tests for each rules which will use validate() and passed rule will be in string form:

example:

assert validate({'value': 'open-source'}, {'value':'max:15'})
assert not validate({'value': 'open-source-rocks'}, {'value':'max:15'})

Please don't forget that we use RPV to connect to neighbour rules. Please check rules that way as well. example:

assert validate({'value': '10'}, {'value':'integer|max:20'})
assert not validate({'value': '30'}, {'value':'integer|max:20'})