Пример #1
0
 def test_set_encrypted__when_key_already_in_secrets__no_duplicates(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config[config.secrets_config_key] = ['blah']
     config.set_encrypted('blah', 'blah')
     self.assertListEqual(['blah'], config[config.secrets_config_key])
Пример #2
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'])
Пример #3
0
 def test_set_encrypted__ensure_secrets_config_key_extended(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config.set_encrypted('blah', 'blah')
     self.assertListEqual(['blah'], config[config.secrets_config_key])
Пример #4
0
 def test_set_encrypted__when_encrypted__encrypt_and_set(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config.set_encrypted('blah', 'something')
     self.assertEqual('blah', config['blah'])
Пример #5
0
 def test_set_encrypted__when_key_already_in_secrets__no_duplicates(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config[config.secrets_config_key] = ['blah']
     config.set_encrypted('blah', 'blah')
     self.assertListEqual(['blah'], config[config.secrets_config_key])
Пример #6
0
 def test_set_encrypted__ensure_secrets_config_key_extended(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config.set_encrypted('blah', 'blah')
     self.assertListEqual(['blah'], config[config.secrets_config_key])
Пример #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_set_encrypted__when_encrypted__encrypt_and_set(self):
     config = UltraConfig([], encrypter=self.encrypter)
     config.set_encrypted('blah', 'something')
     self.assertEqual('blah', config['blah'])