From 3900ac0f14f5a8c29e29c31ce2602e3e2af11a23 Mon Sep 17 00:00:00 2001 From: Dan Ford Date: Mon, 20 Jul 2015 11:45:40 -0400 Subject: [PATCH] Fix bulk indexing tests --- sheer/test_indexing.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sheer/test_indexing.py b/sheer/test_indexing.py index 9c5bd69..1cfafee 100644 --- a/sheer/test_indexing.py +++ b/sheer/test_indexing.py @@ -84,7 +84,8 @@ def test_indexing(self, mock_exists, mock_read_json_file, mock_es.indices.create.assert_called_with(index=self.config['index']) mock_bulk.assert_called_with(mock_es, - self.mock_processor.documents()) + self.mock_processor.documents(), + index='content') @mock.patch('sheer.indexer.bulk') @mock.patch('sheer.indexer.Elasticsearch') @@ -123,7 +124,8 @@ def test_reindexing(self, mock_exists, mock_read_json_file, mock_es.indices.delete.assert_called_with(self.config['index']) mock_es.indices.create.assert_called_with(index=self.config['index']) mock_bulk.assert_called_with(mock_es, - self.mock_processor.documents()) + self.mock_processor.documents(), + index='content') @mock.patch('sheer.indexer.bulk') @mock.patch('sheer.indexer.Elasticsearch') @@ -164,7 +166,8 @@ def test_partial_indexing(self, mock_exists, mock_read_json_file, test_args = AttrDict(processors=['posts'], reindex=False) index_location(test_args, self.config) mock_bulk.assert_called_with(mock_es, - self.mock_processor.documents()) + self.mock_processor.documents(), + index='content') @mock.patch('sheer.indexer.bulk') @mock.patch('sheer.indexer.Elasticsearch') @@ -204,7 +207,8 @@ def test_partial_reindexing(self, mock_exists, mock_read_json_file, index=self.config['index'], doc_type='posts') mock_bulk.assert_called_with(mock_es, - self.mock_processor.documents()) + self.mock_processor.documents(), + index='content') @mock.patch('sheer.indexer.bulk') @mock.patch('sheer.indexer.Elasticsearch') @@ -272,7 +276,8 @@ def test_indexing_failure_ioerr(self, mock_exists, mock_read_json_file, assert 'error making connection' in sys.stderr.getvalue() mock_bulk.assert_called_with(mock_es, - self.mock_processor.documents()) + self.mock_processor.documents(), + index='content') @mock.patch('sheer.indexer.bulk') @mock.patch('sheer.indexer.Elasticsearch')