'Test that mapping moves to another host group.
Should ensure both existing host and destination host are in
multiattach host group and move the mapping to the host group.'

def test_map_volume_to_multiple_hosts_volume_mapped_to_another_host(self):

    existing_host = copy.deepcopy(eseries_fakes.HOST)
    existing_host['clusterRef'] = utils.NULL_REF
    target_host = copy.deepcopy(eseries_fakes.HOST_2)
    target_host['clusterRef'] = utils.NULL_REF
    self.mock_object(self.client, 'get_host', return_value=existing_host)
    self.mock_object(self.client, 'set_host_group_for_host')
    self.mock_object(self.client, 'get_host_group', side_effect=exception.NotFound)
    mock_move_mapping = mock.Mock(return_value=eseries_fakes.VOLUME_MAPPING_TO_MULTIATTACH_GROUP)
    self.mock_object(self.client, 'move_volume_mapping_via_symbol', mock_move_mapping)
    host_mapper.map_volume_to_multiple_hosts(self.client, get_fake_volume(), eseries_fakes.VOLUME, target_host, eseries_fakes.VOLUME_MAPPING)
    self.assertEqual(2, self.client.set_host_group_for_host.call_count)
    self.assertTrue(self.client.move_volume_mapping_via_symbol.called)
