@mock_ec2_deprecated
def test_retrieved_instances_must_contain_their_tags():
    tag_key = 'Tag name'
    tag_value = 'Tag value'
    tags_to_be_set = {tag_key: tag_value}
    conn = boto.connect_ec2('the_key', 'the_secret')
    reservation = conn.run_instances(EXAMPLE_AMI_ID)
    reservation.should.be.a(Reservation)
    reservation.instances.should.have.length_of(1)
    instance = reservation.instances[0]
    reservations = conn.get_all_reservations()
    reservations.should.have.length_of(1)
    reservations[0].id.should.equal(reservation.id)
    instances = reservations[0].instances
    instances.should.have.length_of(1)
    instances[0].id.should.equal(instance.id)
    conn.create_tags([instance.id], tags_to_be_set)
    reservations = conn.get_all_reservations()
    instance = reservations[0].instances[0]
    retrieved_tags = instance.tags
    conn.terminate_instances([instances[0].id])
    retrieved_tags[tag_key].should.equal(tag_value)
@mock_ec2_deprecated
def test_retrieved_instances_must_contain_their_tags():
    tag_key = 'Tag name'
    tag_value = 'Tag value'
    tags_to_be_set = {tag_key: tag_value}
    conn = boto.connect_ec2('the_key', 'the_secret')
    reservation = conn.run_instances(EXAMPLE_AMI_ID)
    reservation.should.be.a(Reservation)
    reservation.instances.should.have.length_of(1)
    instance = reservation.instances[0]
    reservations = conn.get_all_reservations()
    reservations.should.have.length_of(1)
    reservations[0].id.should.equal(reservation.id)
    instances = reservations[0].instances
    instances.should.have.length_of(1)
    instances[0].id.should.equal(instance.id)
    conn.create_tags([instance.id], tags_to_be_set)
    reservations = conn.get_all_reservations()
    instance = reservations[0].instances[0]
    retrieved_tags = instance.tags
    conn.terminate_instances([instances[0].id])
    retrieved_tags[tag_key].should.equal(tag_value)