# Path: openprovider/exceptions.py
# class ValidationError(BadRequest):
#     """A request didn't pass a validation rule."""
# 
# Path: tests/api_tests.py
# def betamaxed(original_function):
#     @wraps(original_function)
#     def new_function(api, *args, **kwargs):
#         with Betamax(api.session).use_cassette(original_function.__name__):
#             return original_function(api, *args, **kwargs)
# 
#     return new_function


import pytest
import uuid
from openprovider.exceptions import ValidationError
from . import betamaxed
    assert results == []


@betamaxed
def test_seach_existing(api):
    email = 'test@example.org'
    results = api.email.search_customer_email_verification_request(email)
    assert len(results) == 1

    result = results[0]
    assert result.name == email
    assert hasattr(result, 'id')
    assert hasattr(result, 'status')


@betamaxed
def test_start_verification(api):
    email = '%s@example.org' % uuid.uuid4()
    results = api.email.start_customer_email_verification_request(email)
    assert results is not None


@betamaxed
def test_restart_non_existing_verification(api):
    email = '%s@example.org' % uuid.uuid4()
    with pytest.raises(ValidationError) as excinfo:
        api.email.restart_customer_email_verification_request(email)
    assert excinfo.value.code == 1203



# Path: openprovider/exceptions.py
# class ValidationError(BadRequest):
#     """A request didn't pass a validation rule."""
# 
# Path: tests/api_tests.py
# def betamaxed(original_function):
#     @wraps(original_function)
#     def new_function(api, *args, **kwargs):
#         with Betamax(api.session).use_cassette(original_function.__name__):
#             return original_function(api, *args, **kwargs)
# 
#     return new_function


# Path: tests/test_email.py
import pytest
import uuid
from openprovider.exceptions import ValidationError
from . import betamaxed

    assert results == []


@betamaxed
def test_seach_existing(api):
    email = 'test@example.org'
    results = api.email.search_customer_email_verification_request(email)
    assert len(results) == 1

    result = results[0]
    assert result.name == email
    assert hasattr(result, 'id')
    assert hasattr(result, 'status')


@betamaxed
def test_start_verification(api):
    email = '%s@example.org' % uuid.uuid4()
    results = api.email.start_customer_email_verification_request(email)
    assert results is not None


@betamaxed
def test_restart_non_existing_verification(api):
    email = '%s@example.org' % uuid.uuid4()
    with pytest.raises(ValidationError) as excinfo:
        api.email.restart_customer_email_verification_request(email)
    assert excinfo.value.code == 1203



@betamaxed