@mock_ec2
def test_request_spot_instances_fulfilled():
 conn = boto.ec2.connect_to_region(u'us-east-1')
 request = conn.request_spot_instances(price=0.5, image_id=u'ami-abcd1234')
 requests = conn.get_all_spot_instance_requests()
 requests.should.have.length_of(1)
 request = requests[0]
 request.state.should.equal(u'open')
 get_model(u'SpotInstanceRequest')[0].state = u'active'
 requests = conn.get_all_spot_instance_requests()
 requests.should.have.length_of(1)
 request = requests[0]
 request.state.should.equal(u'active')

@ mock_ec2 def test_request_spot_instances_fulfilled ( ) : conn = boto . ec2 . connect_to_region ( u'us-east-1' ) request = conn . request_spot_instances ( price = 0.5 , image_id = u'ami-abcd1234' ) requests = conn . get_all_spot_instance_requests ( ) requests . should . have . length_of ( 1 ) request = requests [ 0 ] request . state . should . equal ( u'open' ) get_model ( u'SpotInstanceRequest' ) [ 0 ] . state = u'active' requests = conn . get_all_spot_instance_requests ( ) requests . should . have . length_of ( 1 ) request = requests [ 0 ] request . state . should . equal ( u'active' )
test that moto correctly fullfills a spot instance request .