diff --git a/daybed/indexer/utils.py b/daybed/indexer/utils.py index 165dba8..ec6c7e1 100644 --- a/daybed/indexer/utils.py +++ b/daybed/indexer/utils.py @@ -6,7 +6,8 @@ def build_elasticsearch_hosts(hosts): """Take a list of hosts and build an Elasticsearch parameter list. >>> build_elasticsearch_hosts(['https://admin:password@localhost']) - [{'use_ssl': True, 'host': 'localhost', 'http_auth': 'admin:password', 'port': 443}] + [{'use_ssl': True, 'host': 'localhost', 'http_auth': 'admin:password', \ + 'port': 443}] """ built_hosts = [] diff --git a/daybed/tests/test_indexer.py b/daybed/tests/test_indexer.py index 2929942..577fb0e 100644 --- a/daybed/tests/test_indexer.py +++ b/daybed/tests/test_indexer.py @@ -5,7 +5,6 @@ from daybed.schemas import registry from daybed import indexer -from daybed.indexer.utils import build_elasticsearch_hosts from .support import BaseWebTest, unittest from .test_views import MODEL_DEFINITION, MODEL_RECORD @@ -15,17 +14,17 @@ class ConfigurationTest(unittest.TestCase): @mock.patch('elasticsearch.Elasticsearch') def test_default_config(self, elasticsearch_mock): - new_indexer = indexer.ElasticSearchIndexer(['localhost:9200'], 'daybed_') + indexer.ElasticSearchIndexer(['localhost:9200'], 'daybed_') elasticsearch_mock.assert_called_with(['localhost:9200']) @mock.patch('elasticsearch.Elasticsearch') def test_default_port(self, elasticsearch_mock): - new_indexer = indexer.ElasticSearchIndexer(['localhost'], 'daybed_') + indexer.ElasticSearchIndexer(['localhost'], 'daybed_') elasticsearch_mock.assert_called_with(['localhost']) @mock.patch('elasticsearch.Elasticsearch') def test_http_url(self, elasticsearch_mock): - new_indexer = indexer.ElasticSearchIndexer(['http://localhost:9200'], 'daybed_') + indexer.ElasticSearchIndexer(['http://localhost:9200'], 'daybed_') elasticsearch_mock.assert_called_with([{ 'host': 'localhost', 'port': 9200, @@ -35,7 +34,7 @@ def test_http_url(self, elasticsearch_mock): @mock.patch('elasticsearch.Elasticsearch') def test_https_url(self, elasticsearch_mock): - new_indexer = indexer.ElasticSearchIndexer(['https://localhost'], 'daybed_') + indexer.ElasticSearchIndexer(['https://localhost'], 'daybed_') elasticsearch_mock.assert_called_with([{ 'host': 'localhost', 'port': 443, @@ -45,7 +44,8 @@ def test_https_url(self, elasticsearch_mock): @mock.patch('elasticsearch.Elasticsearch') def test_http_url_with_basic_auth(self, elasticsearch_mock): - new_indexer = indexer.ElasticSearchIndexer(['http://admin:password@localhost'], 'daybed_') + indexer.ElasticSearchIndexer( + ['http://admin:password@localhost'], 'daybed_') elasticsearch_mock.assert_called_with([{ 'host': 'localhost', 'port': 80, @@ -55,7 +55,8 @@ def test_http_url_with_basic_auth(self, elasticsearch_mock): @mock.patch('elasticsearch.Elasticsearch') def test_https_url_with_basic_auth(self, elasticsearch_mock): - new_indexer = indexer.ElasticSearchIndexer(['https://admin:password@localhost'], 'daybed_') + indexer.ElasticSearchIndexer( + ['https://admin:password@localhost'], 'daybed_') elasticsearch_mock.assert_called_with([{ 'host': 'localhost', 'port': 443,