'Tests that _check_requested_secgroups will return a uuid for a
requested Neutron security group and that will be returned from
_validate_and_build_base_options'

def test_validate_and_build_base_options_translate_neutron_secgroup(self):

    instance_type = objects.Flavor(**test_flavor.fake_api_flavor)
    boot_meta = metadata = {}
    kernel_id = ramdisk_id = key_name = key_data = user_data = access_ip_v4 = access_ip_v6 = config_drive = auto_disk_config = reservation_id = None
    requested_secgroups = ['default', 'fake-security-group']
    requested_networks = objects.NetworkRequestList(objects=[objects.NetworkRequest(network_id='none')])
    max_count = 1
    with mock.patch.object(self.compute_api.security_group_api, 'get', return_value={'id': uuids.secgroup_uuid}) as scget:
        (base_options, max_network_count, key_pair, security_groups) = self.compute_api._validate_and_build_base_options(self.context, instance_type, boot_meta, uuids.image_href, mock.sentinel.image_id, kernel_id, ramdisk_id, 'fake-display-name', 'fake-description', key_name, key_data, requested_secgroups, 'fake-az', user_data, metadata, access_ip_v4, access_ip_v6, requested_networks, config_drive, auto_disk_config, reservation_id, max_count)
    scget.assert_called_once_with(self.context, 'fake-security-group')
    self.assertItemsEqual(['default', uuids.secgroup_uuid], security_groups)
