예제 #1
0
    def test_encrypt_decrypt(self):
        text = 'abcd123'
        encrypt = Utility.encrypt(text)
        self.assertTrue(isinstance(encrypt, str))

        decrypt = Utility.decrypt(encrypt)
        self.assertTrue(isinstance(decrypt, str))
        self.assertEqual(decrypt, text)
예제 #2
0
    def __init__(self):
        # init logging
        os.makedirs('logs', exist_ok=True)
        logging.config.dictConfig(Utility.get_logging_config())
        self.logger = logging.getLogger(__name__)
        self.config = Utility.get_config()

        self.args = self.parse_argument()
        self.robinhood = RobinhoodAccount(self.config.robinhood_account,
                                          Utility.decrypt(self.args.rhp))
예제 #3
0
 def test_encrypt_decrypt_empty(self):
     self.assertEqual(Utility.encrypt(''), '')
     self.assertEqual(Utility.decrypt(''), '')
예제 #4
0
 def test_encrypt_decrypt_space(self):
     self.assertEqual(Utility.encrypt('   \t  '), '')
     self.assertEqual(Utility.decrypt('  \t   \t'), '')
예제 #5
0
 def test_encrypt_decrypt_none(self):
     self.assertEqual(Utility.encrypt(None), '')
     self.assertEqual(Utility.decrypt(None), '')