# 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



# These tests are a bit flawed in that we expect some things to exist or not exist, but since
# it's betamaxed we can probably get away with it for a long time


@betamaxed
def test_seach_non_existing(api):
    email = 'nonexisting@example.org'
    results = api.email.search_customer_email_verification_request(email)
    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


# 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




# These tests are a bit flawed in that we expect some things to exist or not exist, but since
# it's betamaxed we can probably get away with it for a long time


@betamaxed
def test_seach_non_existing(api):
    email = 'nonexisting@example.org'
    results = api.email.search_customer_email_verification_request(email)
    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]