def test_FileListEmpty(self): print('empty:',FileList.compress([])) # corrupt the file list compressedFileList = 'base64:' with self.assertRaises(Exception) as e: decompressedFileList = FileList.decompress(compressedFileList)
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)
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)
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)
def test_FileListEmpty(self): print('empty:', FileList.compress([])) # corrupt the file list compressedFileList = 'base64:' with self.assertRaises(Exception) as e: decompressedFileList = FileList.decompress(compressedFileList)
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)
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)