예제 #1
0
파일: tools.py 프로젝트: zpzgone/bottle
def tobs(data):
    ''' Transforms bytes or unicode into a byte stream. '''
    return BytesIO(tob(data))
예제 #2
0
 def test_save_buffer(self):
     fu = FileUpload(open(__file__, 'rb'), 'testfile', __file__)
     buff = BytesIO()
     fu.save(buff)
     buff.seek(0)
     self.assertEqual(fu.file.read(), buff.read())
예제 #3
0
 def test_save_buffer(self):
     fu = FileUpload(open(__file__, 'rb'), 'testfile', __file__)
     buff = BytesIO()
     fu.save(buff)
     buff.seek(0)
     self.assertEqual(fu.file.read(), buff.read())
예제 #4
0
파일: tools.py 프로젝트: xmonader/bottle
def tobs(data):
    """ Transforms bytes or unicode into a byte stream. """
    return BytesIO(tob(data))