Fix EC2 response tags. Closes #37.
This commit is contained in:
parent
af31744dbd
commit
421a5e60af
3 changed files with 41 additions and 9 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import itertools
|
||||
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
|
||||
|
|
@ -19,3 +21,17 @@ def test_instance_launch_and_terminate():
|
|||
|
||||
instance.remove_tag("a key")
|
||||
conn.get_all_tags().should.have.length_of(0)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_instance_launch_and_retrieve_all_instances():
|
||||
conn = boto.connect_ec2('the_key', 'the_secret')
|
||||
reservation = conn.run_instances('ami-1234abcd')
|
||||
instance = reservation.instances[0]
|
||||
|
||||
instance.add_tag("a key", "some value")
|
||||
chain = itertools.chain.from_iterable
|
||||
existing_instances = list(chain([reservation.instances for reservation in conn.get_all_instances()]))
|
||||
existing_instances.should.have.length_of(1)
|
||||
existing_instance = existing_instances[0]
|
||||
existing_instance.tags["a key"].should.equal("some value")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue