def savePicture(sshClient, image, name, email, tempFolder, remoteFolder): formatParams = [int(cv2.IMWRITE_JPEG_QUALITY), 100] filename = encodeSubjectPictureName(name, email) + '.jpg' localpath = tempFolder + '/' + filename logging.debug('Trying to save local file to {0}'.format(localpath)) ret = cv2.imwrite(localpath, image, formatParams) logging.debug('Local file written in {0} with result {1}.'.format(localpath, ret)) sshClient.send(filename, localpath, remoteFolder)
def test_encode(self): x = encodeSubjectPictureName("Juan Gabriel Arias", "*****@*****.**") self.assertEqual(x, "*****@*****.**")