Пример #1
0
 def test_kms_handler_with_region(self):
     region = "us-east-1"
     value = "%s@%s" % (region, self.secret)
     print value
     with mock_kms():
         decrypted = handler(value)
         self.assertEqual(decrypted, self.plain)
Пример #2
0
 def test_kms_handler(self):
     with mock_kms():
         decrypted = handler(self.secret)
         self.assertEqual(decrypted, self.plain)
Пример #3
0
 def test_kms_handler(self):
     with mock_kms():
         decrypted = handler(self.secret)
         print "DECRYPTED: %s" % decrypted
         self.assertEqual(decrypted, self.plain)
Пример #4
0
 def test_kms_handler_with_region(self):
     handler("us-west-2@{}".format(self.input))
     self.assertEqual(self.kms.decrypt.call_args[1]["CiphertextBlob"],
                      "encrypted test value")
     kwargs = self.session.get_session().create_client.call_args[1]
     self.assertEqual(kwargs["region_name"], "us-west-2")
Пример #5
0
 def test_kms_handler(self):
     self.kms.decrypt.return_value = self.value
     decrypted = handler(self.input)
     self.assertEqual(decrypted, self.value["Plaintext"])