示例#1
0
 def test_FileListEmpty(self):
     print('empty:',FileList.compress([]))
     # corrupt the file list
     compressedFileList = 'base64:'
     with self.assertRaises(Exception) as e:
         decompressedFileList = FileList.decompress(compressedFileList)
示例#2
0
 def test_FileListDamaged(self):
     compressedFileList = FileList.compress(self.fileList)
     # corrupt the file list by removing the last character
     compressedFileList = compressedFileList[:-1]
     with self.assertRaises(Exception) as e:
         decompressedFileList = FileList.decompress(compressedFileList)
示例#3
0
 def test_FileListDamaged2(self):
     compressedFileList = FileList.compress(self.fileList)
     # corrupt the file list
     compressedFileList = 'H'+compressedFileList[1:]
     with self.assertRaises(Exception) as e:
         decompressedFileList = FileList.decompress(compressedFileList)
示例#4
0
 def test_FileList(self):
     compressedFileList = FileList.compress(self.fileList)
     decompressedFileList = FileList.decompress(compressedFileList)
     print('uncompressed length:',len(';'.join(self.fileList)))
     print('compressed length:',len(compressedFileList))
     self.assertEqual(self.fileList, decompressedFileList)
示例#5
0
 def test_FileListEmpty(self):
     print('empty:', FileList.compress([]))
     # corrupt the file list
     compressedFileList = 'base64:'
     with self.assertRaises(Exception) as e:
         decompressedFileList = FileList.decompress(compressedFileList)
示例#6
0
 def test_FileListDamaged2(self):
     compressedFileList = FileList.compress(self.fileList)
     # corrupt the file list
     compressedFileList = 'H' + compressedFileList[1:]
     with self.assertRaises(Exception) as e:
         decompressedFileList = FileList.decompress(compressedFileList)
示例#7
0
 def test_FileListDamaged(self):
     compressedFileList = FileList.compress(self.fileList)
     # corrupt the file list by removing the last character
     compressedFileList = compressedFileList[:-1]
     with self.assertRaises(Exception) as e:
         decompressedFileList = FileList.decompress(compressedFileList)
示例#8
0
 def test_FileList(self):
     compressedFileList = FileList.compress(self.fileList)
     decompressedFileList = FileList.decompress(compressedFileList)
     print('uncompressed length:', len(';'.join(self.fileList)))
     print('compressed length:', len(compressedFileList))
     self.assertEqual(self.fileList, decompressedFileList)