add ec2 tags

This commit is contained in:
Steve Pulec 2013-02-20 23:19:43 -05:00
commit f824110ceb
6 changed files with 123 additions and 3 deletions

View file

@ -0,0 +1,20 @@
import boto
from boto.ec2.instance import Reservation, InstanceAttribute
from sure import expect
from moto import mock_ec2
@mock_ec2
def test_instance_launch_and_terminate():
conn = boto.connect_ec2('the_key', 'the_secret')
reservation = conn.run_instances('<ami-image-id>')
instance = reservation.instances[0]
instance.add_tag("a key", "some value")
tags = conn.get_all_tags()
tag = tags[0]
tag.name.should.equal("a key")
tag.value.should.equal("some value")