def test_title_is_required(): data = {} with pytest.raises(ValidationError) as err: info_validator(data) assert_message_in_errors( MESSAGES['required']['required'], err.value.detail, 'required.title', )
def test_description_must_be_a_string(value): data = { 'description': value, } with pytest.raises(ValidationError) as err: info_validator(data) assert_message_in_errors( MESSAGES['type']['invalid'], err.value.detail, 'description.type', )
def test_title_type_must_be_string(value): data = { 'title': value, } with pytest.raises(ValidationError) as err: info_validator(data) assert_message_in_errors( MESSAGES['type']['invalid'], err.value.detail, 'title.type', )
def test_contact_must_be_an_object(value): data = { 'contact': value, } with pytest.raises(ValidationError) as err: info_validator(data) assert_message_in_errors( MESSAGES['type']['invalid'], err.value.detail, 'contact.type', )
def test_license_must_be_an_object(value): data = { 'license': value, } with pytest.raises(ValidationError) as err: info_validator(data) assert_message_in_errors( MESSAGES['type']['invalid'], err.value.detail, 'license.type', )
def test_description_is_not_required(): data = {} try: info_validator(data) except ValidationError as err: errors = err.detail else: errors = {} assert_path_not_in_errors( 'description.required', errors, )
def test_terms_of_service_is_not_required(): data = {} try: info_validator(data) except ValidationError as err: errors = err.detail else: errors = {} assert_path_not_in_errors( 'termsOfService.required', errors, )