def test_stream_write(self):
        # Check stream write with buffer bigger than default 5MB
        self._storage.buffer_size = 7 * 1024 * 1024
        filename = self.gen_random_string()
        # Test 8MB
        content = self.gen_random_string(8 * 1024 * 1024)
        io = StringIOWithError(content)
        assert not self._storage.exists(filename)
        try:
            self._storage.stream_write(filename, io)
        except __HOLE__:
            pass
        assert self._storage.exists(filename)
        # Test that EOFed io string throws IOError on lib/storage/s3
        try:
            self._storage.stream_write(filename, io)
        except IOError:
            pass
        # Cleanup
        io.close()
        self._storage.remove(filename)
        self._storage.buffer_size = 5 * 1024 * 1024
        assert not self._storage.exists(filename)
dataset/ETHPy150Open docker/docker-registry/tests/test_s3.py/TestDriver.test_stream_write