Exemplo n.º 1
0
 def test_normal_send(self):
     queue_to_solr(self.queue, 1, self.solr_connection)
     expected = [
         mock.call([{
             "foo": "bar"
         }], commit=False),
         mock.call([], commit=False),
     ]
     calls = self.solr_connection.add.call_args_list
     self.assertEqual(calls, expected)
Exemplo n.º 2
0
 def test_queue_drained_send(self):
     queue_to_solr(self.queue, 2, self.solr_connection)
     self.solr_connection.add.assert_called_once_with([{"foo": "bar"}])
Exemplo n.º 3
0
 def test_normal_send(self):
     queue_to_solr(self.queue, 1, self.solr_connection)
     expected = [mock.call([{"foo": "bar"}]), mock.call([]), ]
     calls = self.solr_connection.add.call_args_list
     self.assertEqual(calls, expected)
Exemplo n.º 4
0
 def test_queue_drained_send(self):
     queue_to_solr(self.queue, 2, self.solr_connection)
     self.solr_connection.add_many.assert_called_once_with([{"foo": "bar"}])
Exemplo n.º 5
0
 def test_bad_request_ignored(self):
     self.solr_connection.add_many.side_effect = [SolrException(400), None]
     queue_to_solr(self.queue, 1, self.solr_connection)