@@ -96,11 +96,18 @@ def test_GIVEN_valid_request_WHEN_get_encryption_materials_THEN_return_Encryptio
96
96
mock_mpl_cmm .get_encryption_materials .assert_called_once_with (mock_get_encryption_materials_input )
97
97
98
98
99
+ @patch ("aws_encryption_sdk.materials_managers.mpl.cmm.CryptoMaterialsManagerFromMPL"
100
+ "._native_algorithm_id_to_mpl_algorithm_id" )
99
101
@patch ("aws_encryption_sdk.materials_managers.mpl.cmm.CryptoMaterialsManagerFromMPL"
100
102
"._native_to_mpl_commitment_policy" )
101
103
def test_GIVEN_mpl_cmm_raises_MPLException_WHEN_get_encryption_materials_THEN_raise_ESDKException (
102
- _
104
+ _ ,
105
+ mock_mpl_algorithm_id ,
103
106
):
107
+ # Given: _native_algorithm_id_to_mpl_algorithm_id returns a valid MPL algorithm ID
108
+ mock_algorithm_id = "0x1234" # Some fake algorithm ID that fits the format
109
+ mock_mpl_algorithm_id .return_value = mock_algorithm_id
110
+
104
111
# Then: Raises AWSEncryptionSDKClientError
105
112
with pytest .raises (AWSEncryptionSDKClientError ):
106
113
# Given: mpl_cmm.get_encryption_materials raises MPL exception
@@ -111,11 +118,18 @@ def test_GIVEN_mpl_cmm_raises_MPLException_WHEN_get_encryption_materials_THEN_ra
111
118
cmm .get_encryption_materials (mock_encryption_materials_request )
112
119
113
120
121
+ @patch ("aws_encryption_sdk.materials_managers.mpl.cmm.CryptoMaterialsManagerFromMPL"
122
+ "._native_algorithm_id_to_mpl_algorithm_id" )
114
123
@patch ("aws_encryption_sdk.materials_managers.mpl.cmm.CryptoMaterialsManagerFromMPL"
115
124
"._native_to_mpl_commitment_policy" )
116
125
def test_GIVEN_valid_mpl_commitment_policy_WHEN_native_to_mpl_get_encryption_materials_THEN_returns_MPL_GetEncryptionMaterialsInput ( # noqa: E501
117
- mock_mpl_commitment_policy
126
+ mock_mpl_commitment_policy ,
127
+ mock_mpl_algorithm_id ,
118
128
):
129
+ # Given: _native_algorithm_id_to_mpl_algorithm_id returns a valid MPL algorithm ID
130
+ mock_algorithm_id = "0x1234" # Some fake algorithm ID that fits the format
131
+ mock_mpl_algorithm_id .return_value = mock_algorithm_id
132
+
119
133
# Given: commitment policy is some MPL ESDK commitment policy
120
134
mock_commitment_policy = MagicMock (__class__ = MPL_CommitmentPolicyESDK )
121
135
mock_mpl_commitment_policy .return_value = mock_commitment_policy
0 commit comments