Change test_regions.py to work with old boto versions
This commit is contained in:
parent
bce64599f7
commit
55400038a8
@ -17,12 +17,12 @@ def test_add_servers_to_a_single_region():
|
|||||||
add_servers_to_region('ami-5678efgh', 1, region)
|
add_servers_to_region('ami-5678efgh', 1, region)
|
||||||
|
|
||||||
conn = boto.ec2.connect_to_region(region)
|
conn = boto.ec2.connect_to_region(region)
|
||||||
instances = conn.get_only_instances()
|
reservations = conn.get_all_instances()
|
||||||
len(instances).should.equal(2)
|
len(reservations).should.equal(2)
|
||||||
instances.sort(key=lambda x: x.image_id)
|
reservations.sort(key=lambda x: x.instances[0].image_id)
|
||||||
|
|
||||||
instances[0].image_id.should.equal('ami-1234abcd')
|
reservations[0].instances[0].image_id.should.equal('ami-1234abcd')
|
||||||
instances[1].image_id.should.equal('ami-5678efgh')
|
reservations[1].instances[0].image_id.should.equal('ami-5678efgh')
|
||||||
|
|
||||||
|
|
||||||
@mock_ec2
|
@mock_ec2
|
||||||
@ -34,14 +34,14 @@ def test_add_servers_to_multiple_regions():
|
|||||||
|
|
||||||
us_conn = boto.ec2.connect_to_region(region1)
|
us_conn = boto.ec2.connect_to_region(region1)
|
||||||
ap_conn = boto.ec2.connect_to_region(region2)
|
ap_conn = boto.ec2.connect_to_region(region2)
|
||||||
us_instances = us_conn.get_only_instances()
|
us_reservations = us_conn.get_all_instances()
|
||||||
ap_instances = ap_conn.get_only_instances()
|
ap_reservations = ap_conn.get_all_instances()
|
||||||
|
|
||||||
len(us_instances).should.equal(1)
|
len(us_reservations).should.equal(1)
|
||||||
len(ap_instances).should.equal(1)
|
len(ap_reservations).should.equal(1)
|
||||||
|
|
||||||
us_instances[0].image_id.should.equal('ami-1234abcd')
|
us_reservations[0].instances[0].image_id.should.equal('ami-1234abcd')
|
||||||
ap_instances[0].image_id.should.equal('ami-5678efgh')
|
ap_reservations[0].instances[0].image_id.should.equal('ami-5678efgh')
|
||||||
|
|
||||||
|
|
||||||
@mock_autoscaling
|
@mock_autoscaling
|
||||||
|
Loading…
Reference in New Issue
Block a user