From 39bcd81957f446ad01d55a5ab7d50e1f86568b30 Mon Sep 17 00:00:00 2001 From: Honza Kral Date: Sun, 25 Aug 2013 17:58:30 +0200 Subject: [PATCH] Minor fixes --- elasticsearch/connection/thrift.py | 1 + test_elasticsearch/test_transport.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/elasticsearch/connection/thrift.py b/elasticsearch/connection/thrift.py index 7fe96805..2aae067e 100644 --- a/elasticsearch/connection/thrift.py +++ b/elasticsearch/connection/thrift.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import import time try: diff --git a/test_elasticsearch/test_transport.py b/test_elasticsearch/test_transport.py index 4b44973b..95c760c2 100644 --- a/test_elasticsearch/test_transport.py +++ b/test_elasticsearch/test_transport.py @@ -36,7 +36,7 @@ class TestTransport(TestCase): def test_kwargs_passed_on_to_connections(self): t = Transport([{'host': 'google.com'}], port=123) self.assertEquals(1, len(t.connection_pool.connections)) - self.assertEquals('http://google.com:123', t.connection_pool.connections[0].host) + self.assertEquals('%s://google.com:123' % t.connection_pool.connections[0].transport_schema, t.connection_pool.connections[0].host) def test_kwargs_passed_on_to_connection_pool(self): dt = object() @@ -53,10 +53,10 @@ class TestTransport(TestCase): def test_add_connection(self): t = Transport([{}], randomize_hosts=False) - t.add_connection({"host": "google.com"}) + t.add_connection({"host": "google.com", "port": 1234}) self.assertEquals(2, len(t.connection_pool.connections)) - self.assertEquals('http://google.com:9200', t.connection_pool.connections[1].host) + self.assertEquals('%s://google.com:1234' % t.connection_pool.connections[1].transport_schema, t.connection_pool.connections[1].host) def test_request_will_fail_after_X_retries(self): t = Transport([{'exception': ConnectionError('abandon ship')}], connection_class=DummyConnection)