def test_validator(validator_validator, parameters): validator_class = validator.Validator.get_class(parameters.validator_name) assert validator_class is parameters.validator_class validator_instance = validator_class(**parameters.validator_options) assert validator_instance is validator_validator.validate(name='<key>', value=validator_instance, defined=True) has_doc, doc = get_validator_argument(validator_instance, "doc") assert not has_doc
def test_validator_doc(validator_validator, parameters): validator_class = validator.Validator.get_class(parameters.validator_name) assert validator_class is parameters.validator_class doc = "{} doc!".format(validator_class.__name__) validator_instance = validator_class(doc=doc, **parameters.validator_options) assert validator_instance is validator_validator.validate(name='<key>', value=validator_instance, defined=True) has_doc, doc_value = get_validator_argument(validator_instance, "doc") assert has_doc assert doc_value == doc