'Ensure that if there are no inventory records, that we call
_delete_inventory() instead of _update_inventory().'

@mock.patch('nova.scheduler.client.report.SchedulerReportClient._ensure_resource_provider')
@mock.patch('nova.scheduler.client.report.SchedulerReportClient._delete_inventory')
@mock.patch('nova.scheduler.client.report.SchedulerReportClient._update_inventory')
def test_update_compute_node_no_inv(self, mock_ui, mock_delete, mock_erp):

    cn = self.compute_node
    cn.vcpus = 0
    cn.memory_mb = 0
    cn.local_gb = 0
    self.client.update_compute_node(cn)
    mock_erp.assert_called_once_with(cn.uuid, cn.hypervisor_hostname)
    mock_delete.assert_called_once_with(cn.uuid)
    self.assertFalse(mock_ui.called)
