'Tests that passing empty set of inventory records triggers a delete
of inventory for the provider.'

@mock.patch('nova.scheduler.client.report.SchedulerReportClient._update_inventory')
@mock.patch('nova.scheduler.client.report.SchedulerReportClient._delete_inventory')
@mock.patch('nova.scheduler.client.report.SchedulerReportClient._ensure_resource_class')
@mock.patch('nova.scheduler.client.report.SchedulerReportClient._get_or_create_resource_class')
@mock.patch('nova.scheduler.client.report.SchedulerReportClient._ensure_resource_provider')
def test_set_inventory_for_provider_no_inv(self, mock_erp, mock_gocr, mock_erc, mock_del, mock_upd):

    inv_data = {}
    self.client.set_inventory_for_provider(mock.sentinel.rp_uuid, mock.sentinel.rp_name, inv_data)
    mock_erp.assert_called_once_with(mock.sentinel.rp_uuid, mock.sentinel.rp_name)
    self.assertFalse(mock_gocr.called)
    self.assertFalse(mock_erc.called)
    self.assertFalse(mock_upd.called)
    mock_del.assert_called_once_with(mock.sentinel.rp_uuid)
