def test_file_wrapper(self):
    fobj = io.BytesIO(b'data')
    wrapper = wsgi.FileWrapper(fobj, 2)
    self.assertIs(wrapper, iter(wrapper))
    self.assertTrue(hasattr(wrapper, 'close'))
    self.assertEqual(next(wrapper), b'da')
    self.assertEqual(next(wrapper), b'ta')
    self.assertRaises(StopIteration, next, wrapper)
    wrapper = wsgi.FileWrapper(b'data', 2)
    self.assertFalse(hasattr(wrapper, 'close'))
def test_file_wrapper(self):
    fobj = io.BytesIO(b'data')
    wrapper = wsgi.FileWrapper(fobj, 2)
    self.assertIs(wrapper, iter(wrapper))
    self.assertTrue(hasattr(wrapper, 'close'))
    self.assertEqual(next(wrapper), b'da')
    self.assertEqual(next(wrapper), b'ta')
    self.assertRaises(StopIteration, next, wrapper)
    wrapper = wsgi.FileWrapper(b'data', 2)
    self.assertFalse(hasattr(wrapper, 'close'))