Best Python code snippet using localstack_python
test_kms.py
Source:test_kms.py
...48 grants_before = kms_client.list_grants(KeyId=key_id)["Grants"]49 kms_client.revoke_grant(KeyId=key_id, GrantId=grant["GrantId"])50 grants_after = kms_client.list_grants(KeyId=key_id)["Grants"]51 assert len(grants_after) == len(grants_before) - 152 def test_retire_grant(self, kms_client, kms_grant_and_key):53 grant = kms_grant_and_key[0]54 key_id = kms_grant_and_key[1]["KeyMetadata"]["KeyId"]55 grants_before = kms_client.list_grants(KeyId=key_id)["Grants"]56 kms_client.retire_grant(GrantToken=grant["GrantToken"])57 grants_after = kms_client.list_grants(KeyId=key_id)["Grants"]58 assert len(grants_after) == len(grants_before) - 159 def test_asymmetric_keys(self, kms_client, kms_key):60 key_id = kms_key["KeyMetadata"]["KeyId"]61 # generate key pair without plaintext62 result = kms_client.generate_data_key_pair_without_plaintext(63 KeyId=key_id, KeyPairSpec="RSA_2048"64 )65 assert result.get("PrivateKeyCiphertextBlob")66 assert not result.get("PrivateKeyPlaintext")...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!