예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)