'Test check_deltas with a negative delta.
Negative deltas probably won\'t be used going forward for countable
resources because there are no usage records to decrement and there
won\'t be quota operations done when deleting resources. When resources
are deleted, they will no longer be reflected in the count.'

@mock.patch('nova.objects.Quotas.count_as_dict')
def test_check_deltas_negative(self, mock_count):

    self.flags(key_pairs=3, group='quota')
    mock_count.return_value = {'user': {'key_pairs': 4}}
    deltas = {'key_pairs': (-1)}
    quotas_obj.Quotas.check_deltas(self.context, deltas, 'a-user', something='something')
    mock_count.assert_called_once_with(self.context, 'key_pairs', 'a-user', something='something')
