Support python 2.6

This commit is contained in:
Honza Kral
2013-08-27 04:07:52 +02:00
parent 87a09091ce
commit 158f6e6183
7 changed files with 19 additions and 17 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ import requests
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import ConnectionError
from unittest import SkipTest, TestCase
from unittest import TestCase
from nose import SkipTest
data_dir = None
@@ -6,7 +6,7 @@ clients.
from os import walk, environ
from os.path import exists, join, dirname, pardir
import yaml
from unittest import SkipTest
from nose import SkipTest
from . import ElasticTestCase
@@ -53,7 +53,7 @@ class YamlTestCase(ElasticTestCase):
# resolve variables
if isinstance(value, (type(u''), type(''))) and value.startswith('$'):
value = value[1:]
self.assertIn(value, self._state)
self.assertTrue(value in self._state)
value = self._state[value]
return value
@@ -67,10 +67,10 @@ class YamlTestCase(ElasticTestCase):
step = step.replace('\1', '.')
if step.isdigit():
step = int(step)
self.assertIsInstance(value, list)
self.assertGreater(len(value), step)
self.assertTrue(isinstance(value, list))
self.assertTrue(len(value) > step)
else:
self.assertIn(step, value)
self.assertTrue(step in value)
value = value[step]
return value
@@ -133,11 +133,11 @@ class YamlTestCase(ElasticTestCase):
def run_gt(self, action):
for key, value in action.items():
self.assertGreater(self._lookup(key), value)
self.assertTrue(self._lookup(key) > value)
def run_lt(self, action):
for key, value in action.items():
self.assertLess(self._lookup(key), value)
self.assertTrue(self._lookup(key) < value)
def run_set(self, action):
for key, value in action.items():
@@ -5,7 +5,7 @@ from elasticsearch.transport import ADDRESS_RE
from . import ElasticTestCase
from unittest import SkipTest
from nose import SkipTest
class TestMemcachedConnection(ElasticTestCase):
def setUp(self):