'Test volume mapped to host not in specified host group.
Ensure an error is raised if the specified host is not in the
host group the volume is mapped to.'

def test_unmap_volume_from_host_volume_mapped_to_host_group_but_not_host(self):

    fake_eseries_volume = copy.deepcopy(eseries_fakes.VOLUME)
    fake_volume_mapping = copy.deepcopy(eseries_fakes.VOLUME_MAPPING)
    fake_volume_mapping['mapRef'] = eseries_fakes.MULTIATTACH_HOST_GROUP['clusterRef']
    fake_eseries_volume['listOfMappings'] = [fake_volume_mapping]
    self.mock_object(self.client, 'list_volumes', return_value=[fake_eseries_volume])
    fake_host = copy.deepcopy(eseries_fakes.HOST)
    fake_host['clusterRef'] = utils.NULL_REF
    self.mock_object(self.client, 'list_hosts', return_value=[fake_host])
    err = self.assertRaises(exception.NetAppDriverException, host_mapper.unmap_volume_from_host, self.client, get_fake_volume(), fake_host, fake_volume_mapping)
    self.assertIn('not    currently    mapped    to    host', six.text_type(err))
