コード例 #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
ファイル: test_fileupload.py プロジェクト: 326029212/bottle
 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))