def test_list_validation_index_on_exception(): field = ListField(StringField()) try: field.validate(FIELD_NAME, TEST_LIST_MIXED) except ListFieldInvalidError as e: assert e.index == 1
def test_list_validation_success(): field = ListField(StringField()) field.validate(FIELD_NAME, TEST_LIST_STRINGS)
def test_list_validation_error_type(): field = ListField(StringField()) field.validate(FIELD_NAME, TEST_LIST_MIXED)
def test_list_validation_success_empty(): field = ListField(StringField()) field.validate(FIELD_NAME, TEST_LIST_EMPTY)