# Path: doubles/lifecycle.py
# def current_space():
# def teardown():
# def clear(*objects_to_clear):
# def verify():
# def no_builtin_verification():
# def ignore_builtin_verification():
# 
# Path: doubles/targets/allowance_target.py
# def allow(target):
#     """
#     Prepares a target object for a method call allowance (stub). The name of the method to allow
#     should be called as a method on the return value of this function::
# 
#         allow(foo).bar
# 
#     Accessing the ``bar`` attribute will return an ``Allowance`` which provides additional methods
#     to configure the stub.
# 
#     :param object target: The object that will be stubbed.
#     :return: An ``AllowanceTarget`` for the target object.
#     """
# 
#     return AllowanceTarget(target)
# 
# Path: doubles/targets/expectation_target.py
# def expect(target):
#     """
#     Prepares a target object for a method call expectation (mock). The name of the method to expect
#     should be called as a method on the return value of this function::
# 
#         expect(foo).bar
# 
#     Accessing the ``bar`` attribute will return an ``Expectation`` which provides additional methods
#     to configure the mock.
# 
#     :param object target: The object that will be mocked.
#     :return: An ``ExpectationTarget`` for the target object.
#     """
# 
#     return ExpectationTarget(target)


from threading import Thread
    from Queue import Queue
    from queue import Queue
from doubles import lifecycle, expect, allow, clear
import doubles.testing

    def test_does_not_raise_expectation_errors(self):
        expect(doubles.testing).top_level_function
        clear(doubles.testing)

    def test_new_allowances_can_be_set(self):
        (allow(doubles.testing).
            top_level_function.
            with_args('Bob Barker').
            and_return('Drew Carey'))

        clear(doubles.testing)
        allow(doubles.testing).top_level_function.and_return('Bob Barker')

        assert doubles.testing.top_level_function('bar') == 'Bob Barker'

    def test_clearing_an_instance(self):
        user = doubles.testing.User('Bob Barker', 25)
        (allow(user).
            method_with_positional_arguments.
            with_args(25).
            and_return('The price is right'))

        clear(user)
        allow(user).method_with_positional_arguments.and_return('The price is wrong')

        assert user.method_with_positional_arguments(10) == 'The price is wrong'

    def test_calling_twice(self):
        expect(doubles.testing).top_level_function

# Path: doubles/lifecycle.py
# def current_space():
# def teardown():
# def clear(*objects_to_clear):
# def verify():
# def no_builtin_verification():
# def ignore_builtin_verification():
# 
# Path: doubles/targets/allowance_target.py
# def allow(target):
#     """
#     Prepares a target object for a method call allowance (stub). The name of the method to allow
#     should be called as a method on the return value of this function::
# 
#         allow(foo).bar
# 
#     Accessing the ``bar`` attribute will return an ``Allowance`` which provides additional methods
#     to configure the stub.
# 
#     :param object target: The object that will be stubbed.
#     :return: An ``AllowanceTarget`` for the target object.
#     """
# 
#     return AllowanceTarget(target)
# 
# Path: doubles/targets/expectation_target.py
# def expect(target):
#     """
#     Prepares a target object for a method call expectation (mock). The name of the method to expect
#     should be called as a method on the return value of this function::
# 
#         expect(foo).bar
# 
#     Accessing the ``bar`` attribute will return an ``Expectation`` which provides additional methods
#     to configure the mock.
# 
#     :param object target: The object that will be mocked.
#     :return: An ``ExpectationTarget`` for the target object.
#     """
# 
#     return ExpectationTarget(target)


# Path: test/lifecycle_test.py
from threading import Thread
    from Queue import Queue
    from queue import Queue
from doubles import lifecycle, expect, allow, clear
import doubles.testing


    def test_does_not_raise_expectation_errors(self):
        expect(doubles.testing).top_level_function
        clear(doubles.testing)

    def test_new_allowances_can_be_set(self):
        (allow(doubles.testing).
            top_level_function.
            with_args('Bob Barker').
            and_return('Drew Carey'))

        clear(doubles.testing)
        allow(doubles.testing).top_level_function.and_return('Bob Barker')

        assert doubles.testing.top_level_function('bar') == 'Bob Barker'

    def test_clearing_an_instance(self):
        user = doubles.testing.User('Bob Barker', 25)
        (allow(user).
            method_with_positional_arguments.
            with_args(25).
            and_return('The price is right'))

        clear(user)
        allow(user).method_with_positional_arguments.and_return('The price is wrong')

        assert user.method_with_positional_arguments(10) == 'The price is wrong'

    def test_calling_twice(self):
        expect(doubles.testing).top_level_function

        clear(doubles.testing)