

def test_error_in_iterator(self):
    app = catch_errors.CatchErrorMiddleware(FakeApp(body_iter=(int(x) for x in 'abcd')), {
        
    })
    req = Request.blank('/', environ={
        'REQUEST_METHOD': 'GET',
    })
    resp = app(req.environ, start_response)
    self.assertEqual(list(resp), ['An error occurred'])

dataset/ETHPy150Open openstack/swift/test/unit/common/middleware/test_except.py TestCatchErrors.test_error_in_iterator/original