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