'Test replication freeze_host.'

@mock.patch.object(volume_rpcapi.VolumeAPI, 'freeze_host')
@mock.patch.object(cinder.db, 'conditional_update', return_value=1)
@mock.patch.object(cinder.objects.ServiceList, 'get_all')
def test_freeze_host(self, mock_get_all, mock_db_update, mock_freeze):

    service = fake_service.fake_service_obj(self.context, binary='cinder-volume')
    mock_get_all.return_value = [service]
    mock_freeze.return_value = True
    volume_api = cinder.volume.api.API()
    volume_api.freeze_host(self.context, host=CONF.host, cluster_name=None)
    mock_freeze.assert_called_once_with(self.context, service)
