def test__do_multipart_upload_bad_size(self):
    blob = self._make_one(u'blob-name', bucket=None)
    data = b'data here hear hier'
    stream = io.BytesIO(data)
    size = 50
    self.assertGreater(size, len(data))
    with self.assertRaises(ValueError) as exc_info:
        blob._do_multipart_upload(None, stream, None, size, None)
    exc_contents = str(exc_info.exception)
    self.assertIn('was specified but the file-like object only had', exc_contents)
    self.assertEqual(stream.tell(), len(data))
def test__do_multipart_upload_bad_size(self):
    blob = self._make_one(u'blob-name', bucket=None)
    data = b'data here hear hier'
    stream = io.BytesIO(data)
    size = 50
    self.assertGreater(size, len(data))
    with self.assertRaises(ValueError) as exc_info:
        blob._do_multipart_upload(None, stream, None, size, None)
    exc_contents = str(exc_info.exception)
    self.assertIn('was specified but the file-like object only had', exc_contents)
    self.assertEqual(stream.tell(), len(data))