From c688e43a9a9ba01b41845a3f1a23ada104d54338 Mon Sep 17 00:00:00 2001 From: Konstantinos Koukopoulos Date: Mon, 24 Feb 2014 12:24:46 +0200 Subject: [PATCH] add test for create_key_pair --- tests/test_ec2/test_key_pairs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_ec2/test_key_pairs.py b/tests/test_ec2/test_key_pairs.py index a5e35455d..9b488e3d9 100644 --- a/tests/test_ec2/test_key_pairs.py +++ b/tests/test_ec2/test_key_pairs.py @@ -8,3 +8,10 @@ from moto import mock_ec2 def test_key_pairs_empty(): conn = boto.connect_ec2('the_key', 'the_secret') assert len(conn.get_all_key_pairs()) == 0 + + +@mock_ec2 +def test_key_pairs_create(): + conn = boto.connect_ec2('the_key', 'the_secret') + kp = conn.create_key_pair('foo') + assert kp.material.startswith('-----BEGIN RSA PRIVATE KEY-----')