add ec2 tags
This commit is contained in:
parent
568d99dd42
commit
f824110ceb
6 changed files with 123 additions and 3 deletions
20
tests/test_ec2/test_tags.py
Normal file
20
tests/test_ec2/test_tags.py
Normal 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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue