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)
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))
def test_encrypt_decrypt_empty(self): self.assertEqual(Utility.encrypt(''), '') self.assertEqual(Utility.decrypt(''), '')
def test_encrypt_decrypt_space(self): self.assertEqual(Utility.encrypt(' \t '), '') self.assertEqual(Utility.decrypt(' \t \t'), '')
def test_encrypt_decrypt_none(self): self.assertEqual(Utility.encrypt(None), '') self.assertEqual(Utility.decrypt(None), '')