diff --git a/moto/kms/responses.py b/moto/kms/responses.py index 7ed8927a..0f544e95 100644 --- a/moto/kms/responses.py +++ b/moto/kms/responses.py @@ -231,7 +231,6 @@ class KmsResponse(BaseResponse): def decrypt(self): value = self.parameters.get("CiphertextBlob") - print("value 3", value) return json.dumps({"Plaintext": base64.b64decode(value).decode("utf-8")}) diff --git a/tests/test_kms/test_kms.py b/tests/test_kms/test_kms.py index e1468cce..8d034c7f 100644 --- a/tests/test_kms/test_kms.py +++ b/tests/test_kms/test_kms.py @@ -1,11 +1,12 @@ from __future__ import unicode_literals import re +import boto3 import boto.kms from boto.exception import JSONResponseError from boto.kms.exceptions import AlreadyExistsException, NotFoundException import sure # noqa -from moto import mock_kms_deprecated +from moto import mock_kms, mock_kms_deprecated from nose.tools import assert_raises @@ -600,3 +601,12 @@ def test__assert_default_policy(): "not-default").should.throw(JSONResponseError) _assert_default_policy.when.called_with( "default").should_not.throw(JSONResponseError) + + +@mock_kms +def test_kms_encrypt_boto3(): + client = boto3.client('kms', region_name='us-east-1') + response = client.encrypt(KeyId='foo', Plaintext=b'bar') + + response = client.decrypt(CiphertextBlob=response['CiphertextBlob']) + response['Plaintext'].should.equal(b'bar')