Introducing DummyConnectionPool for when only 1 connection defined
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import time
|
||||
|
||||
from elasticsearch.connection_pool import ConnectionPool, RoundRobinSelector
|
||||
from elasticsearch.connection_pool import ConnectionPool, RoundRobinSelector, DummyConnectionPool
|
||||
from elasticsearch.exceptions import ImproperlyConfigured
|
||||
|
||||
from .test_cases import TestCase
|
||||
|
||||
class TestConnectionPool(TestCase):
|
||||
def test_dummy_cp_raises_exception_on_more_connections(self):
|
||||
self.assertRaises(ImproperlyConfigured, DummyConnectionPool, [])
|
||||
self.assertRaises(ImproperlyConfigured, DummyConnectionPool, [object(), object()])
|
||||
|
||||
def test_raises_exception_when_no_connections_defined(self):
|
||||
self.assertRaises(ImproperlyConfigured, ConnectionPool, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user