@mock_ec2
def test_request_spot_instances_default_arguments():
    '\n    Test that moto set the correct default arguments\n    '
    conn = boto.connect_ec2()
    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')
    request.price.should.equal(0.5)
    request.launch_specification.image_id.should.equal('ami-abcd1234')
    request.type.should.equal('one-time')
    request.valid_from.should.equal(None)
    request.valid_until.should.equal(None)
    request.launch_group.should.equal(None)
    request.availability_zone_group.should.equal(None)
    request.launch_specification.key_name.should.equal(None)
    security_group_names = [group.name for group in request.launch_specification.groups]
    security_group_names.should.equal(['default'])
    request.launch_specification.instance_type.should.equal('m1.small')
    request.launch_specification.placement.should.equal(None)
    request.launch_specification.kernel.should.equal(None)
    request.launch_specification.ramdisk.should.equal(None)
    request.launch_specification.subnet_id.should.equal(None)
Test that moto set the correct default arguments
@mock_ec2
def test_request_spot_instances_default_arguments():
    '\n    \n    '
    conn = boto.connect_ec2()
    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')
    request.price.should.equal(0.5)
    request.launch_specification.image_id.should.equal('ami-abcd1234')
    request.type.should.equal('one-time')
    request.valid_from.should.equal(None)
    request.valid_until.should.equal(None)
    request.launch_group.should.equal(None)
    request.availability_zone_group.should.equal(None)
    request.launch_specification.key_name.should.equal(None)
    security_group_names = [group.name for group in request.launch_specification.groups]
    security_group_names.should.equal(['default'])
    request.launch_specification.instance_type.should.equal('m1.small')
    request.launch_specification.placement.should.equal(None)
    request.launch_specification.kernel.should.equal(None)
    request.launch_specification.ramdisk.should.equal(None)
    request.launch_specification.subnet_id.should.equal(None)