tests/functional/tests/conftest.py
def symmetric_key(kms_client):
    """
    Create a temporary symmetric key for use in tests that require one.
    The key is marked for deletion once the tests have finished.
    We don't actually test the creation/deletion process here; it's assumed to work.
    :param kms_client:
    :return:
    """
    code, content = kms_client.post('CreateKey')

    yield content['KeyMetadata']

    code, unused = kms_client.post('ScheduleKeyDeletion', {
        'KeyId': content['KeyMetadata']['KeyId'],
        'PendingWindowInDays': 7
    })
    if code != 200:
        raise ValueError('Unable to delete test key %s' % content['KeyMetadata']['KeyId'])

    Create a temporary symmetric key for use in tests that require one.
    The key is marked for deletion once the tests have finished.
    We don't actually test the creation/deletion process here; it's assumed to work.
    :param kms_client:
    :return:
    
Create a temporary symmetric key for use in tests that require one.
The key is marked for deletion once the tests have finished.
We don't actually test the creation/deletion process here; it's assumed to work.
Create a temporary symmetric key for use in tests that require one . The key is marked for deletion once the tests have finished . We don ' t actually test the creation / deletion process here ; it ' s assumed to work .
def symmetric_key(kms_client):
    code, content = kms_client.post('CreateKey')
    yield content['KeyMetadata']
    code, unused = kms_client.post('ScheduleKeyDeletion', {
        'KeyId': content['KeyMetadata']['KeyId'],
        'PendingWindowInDays': 7
    })
    if code != 200:
        raise ValueError('Unable to delete test key %s' % content['KeyMetadata']['KeyId'])
def symmetric_key ( kms_client ) : code , content = kms_client . post ( 'CreateKey' ) yield content [ 'KeyMetadata' ] code , unused = kms_client . post ( 'ScheduleKeyDeletion' , { 'KeyId' : content [ 'KeyMetadata' ] [ 'KeyId' ] , 'PendingWindowInDays' : 7 } ) if code != 200 : raise ValueError ( 'Unable to delete test key %s' % content [ 'KeyMetadata' ] [ 'KeyId' ] )
Create a temporary symmetric key for use in tests that require one.
Create a temporary symmetric key for use in tests that require one .
"""
    Create a temporary symmetric key for use in tests that require one.
    The key is marked for deletion once the tests have finished.
    We don't actually test the creation/deletion process here; it's assumed to work.
    :param kms_client:
    :return:
    """
None
kms_client
None