コード例 #1
0
 def test_decrypt__when_not_decrypted__decrypt_secrets(self):
     config = UltraConfig([], decrypter=self.encrypter)
     config['blah'] = 'something'
     config['SECRETS'] = ['blah']
     config.decrypted = False
     config.decrypt()
     self.assertEqual('blah', config['blah'])
コード例 #2
0
 def test_decrypt__when_not_decrypted__decrypt_secrets(self):
     config = UltraConfig([], decrypter=self.encrypter)
     config['blah'] = 'something'
     config['SECRETS'] = ['blah']
     config.decrypted = False
     config.decrypt()
     self.assertEqual('blah', config['blah'])
コード例 #3
0
 def test_encrypt__when_already_encrypted__raise_value_error(self):
     config = UltraConfig([])
     config.decrypted = False
     self.assertRaises(ValueError, config.encrypt)
コード例 #4
0
 def test_get_encrypted__when_not_encrypted__return(self):
     config = UltraConfig([], decrypter=self.encrypter)
     config.decrypted = True
     config['blah'] = 'something'
     resp = config.get_encrypted('blah')
     self.assertEqual('something', resp)
コード例 #5
0
 def test_set_encrypted__when_not_encrypted__set_raw_value(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config.decrypted = True
     config.set_encrypted('blah', 'something')
     self.assertEqual('something', config['blah'])
コード例 #6
0
 def test_get_encrypted__when_not_encrypted__return(self):
     config = UltraConfig([], decrypter=self.encrypter)
     config.decrypted = True
     config['blah'] = 'something'
     resp = config.get_encrypted('blah')
     self.assertEqual('something', resp)
コード例 #7
0
 def test_set_encrypted__when_not_encrypted__set_raw_value(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config.decrypted = True
     config.set_encrypted('blah', 'something')
     self.assertEqual('something', config['blah'])
コード例 #8
0
 def test_decrypt__when_already_decrypted__raise_value_error(self):
     config = UltraConfig([])
     config.decrypted = True
     self.assertRaises(ValueError, config.decrypt)