Adding server mode

This commit is contained in:
Steve Pulec 2013-03-05 08:14:43 -05:00
commit a728b2581a
31 changed files with 489 additions and 66 deletions

View file

@ -9,7 +9,7 @@ from moto import mock_ec2
@mock_ec2
def test_ami_create_and_delete():
conn = boto.connect_ec2('the_key', 'the_secret')
reservation = conn.run_instances('<ami-image-id>')
reservation = conn.run_instances('ami-1234abcd')
instance = reservation.instances[0]
image = conn.create_image(instance.id, "test-ami", "this is a test ami")
@ -23,13 +23,14 @@ def test_ami_create_and_delete():
@mock_ec2
def test_ami_create_from_missing_instance():
conn = boto.connect_ec2('the_key', 'the_secret')
conn.create_image.when.called_with("i-abcdefg", "test-ami", "this is a test ami").should.throw(EC2ResponseError)
args = ["i-abcdefg", "test-ami", "this is a test ami"]
conn.create_image.when.called_with(*args).should.throw(EC2ResponseError)
@mock_ec2
def test_ami_pulls_attributes_from_instance():
conn = boto.connect_ec2('the_key', 'the_secret')
reservation = conn.run_instances('<ami-image-id>')
reservation = conn.run_instances('ami-1234abcd')
instance = reservation.instances[0]
instance.modify_attribute("kernel", "test-kernel")