示例#1
0
 def test_decryptFileWithSameLocation(self):
     validFilePath = r"C:\Users\Gulyani\Dropbox\work\new work\EXE locker\EXE_locker\test_file\BTSync.exelocker"
     eFile = EncryptedFile(validFilePath)
     password = EncryptionHelper.generateKeyHash("password")
     sameLocation = True
     eFile.decryptFile(password, sameLocation)
     decryptedFileName = eFile.getOriginalFileName()
     unencryptedFileLocation = os.path.join(os.path.dirname(validFilePath), decryptedFileName)
     self.assertTrue(os.path.exists(unencryptedFileLocation))
示例#2
0
 def test_isValidFile(self):
     validFilePath = r"G:\work\EXE locker\EXE_locker\test_file\prog.exelocker"
     invalidFile = r"G:\work\EXE locker\EXE_locker\test_file\prog.py"
     self.assertTrue(EncryptedFile.isValidFile(validFilePath))
     self.assertFalse(EncryptedFile.isValidFile(invalidFile))
示例#3
0
 def test_decryptFile(self):
     validFilePath = r"C:\Users\Gulyani\Dropbox\work\new work\EXE locker\EXE_locker\test_file\BTSync.exelocker"
     eFile = EncryptedFile(validFilePath)
     password = EncryptionHelper.generateKeyHash("password")
     eFile.decryptFile(password)
     self.assertTrue(os.path.exists(eFile.getOriginalFileName()))
示例#4
0
 def test_createEncryptedFile(self):
     filePath = r"G:\work\EXE locker\EXE_locker\test_file\prog.py"
     encryptedFilePath = r"G:\work\EXE locker\EXE_locker\test_file\prog.exelocker"
     file = EncryptedFile.createEncryptedFile(filePath, "password")
     self.assertTrue(os.path.exists(encryptedFilePath))
     self.assertIsInstance(file, EncryptedFile)