Fix memcached tests for py3
This commit is contained in:
@@ -5,7 +5,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
from ..exceptions import TransportError, ConnectionError
|
from ..exceptions import TransportError, ConnectionError, ImproperlyConfigured
|
||||||
from .pooling import PoolingConnection
|
from .pooling import PoolingConnection
|
||||||
|
|
||||||
class MemcachedConnection(PoolingConnection):
|
class MemcachedConnection(PoolingConnection):
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
THRIFT_AVAILABLE = False
|
THRIFT_AVAILABLE = False
|
||||||
|
|
||||||
from ..exceptions import ConnectionError
|
from ..exceptions import ConnectionError, ImproperlyConfigured
|
||||||
from .pooling import PoolingConnection
|
from .pooling import PoolingConnection
|
||||||
|
|
||||||
class ThriftConnection(PoolingConnection):
|
class ThriftConnection(PoolingConnection):
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
__all__ = ['ElastiSearchException', 'SerializationError', 'TransportError', 'NotFoundError']
|
__all__ = ['ImproperlyConfigured', 'ElastiSearchException', 'SerializationError', 'TransportError', 'NotFoundError']
|
||||||
|
|
||||||
|
class ImproperlyConfigured(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
class ElastiSearchException(Exception):
|
class ElastiSearchException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ from unittest import SkipTest
|
|||||||
|
|
||||||
class TestMemcachedConnection(ElasticTestCase):
|
class TestMemcachedConnection(ElasticTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
try:
|
||||||
|
import pylibmc
|
||||||
|
except ImportError:
|
||||||
|
raise SkipTest("No pylibmc.")
|
||||||
super(TestMemcachedConnection, self).setUp()
|
super(TestMemcachedConnection, self).setUp()
|
||||||
nodes = self.client.cluster.node_info()
|
nodes = self.client.cluster.node_info()
|
||||||
for node_id, node_info in nodes["nodes"].items():
|
for node_id, node_info in nodes["nodes"].items():
|
||||||
|
|||||||
Reference in New Issue
Block a user