moto/tests/test_ec2/test_utils.py
Daniel Miranda fb2a76fd66 ec2: add support for creation and importing of real SSH keys (#2108)
* ec2: add support for creation and importing of real SSH keys

* setup: lock PyYAML version to avoid incompatibilities
2019-05-25 11:17:52 +01:00

13 lines
348 B
Python

from moto.ec2 import utils
from .helpers import rsa_check_private_key
def test_random_key_pair():
key_pair = utils.random_key_pair()
rsa_check_private_key(key_pair['material'])
# AWS uses MD5 fingerprints, which are 47 characters long, *not* SHA1
# fingerprints with 59 characters.
assert len(key_pair['fingerprint']) == 47