def test_use_as_decorator_on_coroutine():
    original_http_connetion = httplib.HTTPConnection

    @Cassette.use(inject=True)
    def test_function(cassette):
        assert httplib.HTTPConnection.cassette is cassette
        assert httplib.HTTPConnection is not original_http_connetion
        value = yield 1
        assert value == 1
        assert httplib.HTTPConnection.cassette is cassette
        assert httplib.HTTPConnection is not original_http_connetion
        value = yield 2
        assert value == 2

    coroutine = test_function()
    value = next(coroutine)
    while True:
        try:
            value = coroutine.send(value)
        except __HOLE__:
            break
dataset/ETHPy150Open kevin1024/vcrpy/tests/unit/test_cassettes.py/test_use_as_decorator_on_coroutine