Here are the examples of the python api aiohttp.wsgi.FileWrapper taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Example 1
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'))