diff --git a/tests/test_kms/test_utils.py b/tests/test_kms/test_utils.py index 9d540d50..466c72ea 100644 --- a/tests/test_kms/test_utils.py +++ b/tests/test_kms/test_utils.py @@ -6,11 +6,12 @@ from parameterized import parameterized from moto.kms.exceptions import AccessDeniedException, InvalidCiphertextException, NotFoundException from moto.kms.models import Key from moto.kms.utils import ( + _deserialize_ciphertext_blob, + _serialize_ciphertext_blob, + _serialize_encryption_context, generate_data_key, generate_master_key, - _serialize_ciphertext_blob, - _deserialize_ciphertext_blob, - _serialize_encryption_context, + MASTER_KEY_LEN, encrypt, decrypt, Ciphertext, @@ -45,6 +46,20 @@ CIPHERTEXT_BLOB_VECTORS = ( ) +def test_generate_data_key(): + test = generate_data_key(123) + + test.should.be.a(bytes) + len(test).should.equal(123) + + +def test_generate_master_key(): + test = generate_master_key() + + test.should.be.a(bytes) + len(test).should.equal(MASTER_KEY_LEN) + + @parameterized(ENCRYPTION_CONTEXT_VECTORS) def test_serialize_encryption_context(raw, serialized): test = _serialize_encryption_context(raw)