def test_media_io_base_upload_streamable(self): fd = BytesIO(b'stuff') upload = MediaIoBaseUpload(fd=fd, mimetype='image/png', chunksize=500, resumable=True) self.assertEqual(True, upload.has_stream()) self.assertEqual(fd, upload.stream())
def test_media_io_base_upload_streamable(self): try: import io fd = io.BytesIO('stuff') upload = MediaIoBaseUpload( fd=fd, mimetype='image/png', chunksize=500, resumable=True) self.assertEqual(True, upload.has_stream()) self.assertEqual(fd, upload.stream()) except ImportError: pass
def test_media_io_base_upload_streamable(self): fd = BytesIO(b'stuff') upload = MediaIoBaseUpload( fd=fd, mimetype='image/png', chunksize=500, resumable=True) self.assertEqual(True, upload.has_stream()) self.assertEqual(fd, upload.stream())