def test_element_schema_validate_fail(): utils.reset_message_counters() es = ElementSchema('testable', validator=PositiveInteger()) # noinspection PyProtectedMember es._validate(es.validator, 'NaN', es.tag, path='/') nose.tools.eq_(utils.error_count, 1)
def test_element_schema_validate_pass(): es = ElementSchema('testable', validator=PositiveInteger()) # noinspection PyProtectedMember value = es._validate(es.validator, '42', es._tag, path='/') nose.tools.eq_(value, 42)