Skip on feature for yaml tests

This commit is contained in:
Honza Král
2014-02-03 19:10:58 +01:00
parent 27efc6d05a
commit cfcf062f6a
+13 -6
View File
@@ -26,6 +26,9 @@ CATCH_CODES = {
'conflict': 409, 'conflict': 409,
} }
# test features we have implemented
IMPLEMENTED_FEATURES = ()
class InvalidActionType(Exception): class InvalidActionType(Exception):
pass pass
@@ -108,12 +111,16 @@ class YamlTestCase(ElasticTestCase):
raise AssertionError('Failed to catch %r in %r.' % (catch, self.last_response)) raise AssertionError('Failed to catch %r in %r.' % (catch, self.last_response))
def run_skip(self, skip): def run_skip(self, skip):
version, reason = skip['version'], skip['reason'] if 'features' in skip and skip['features'] not in IMPLEMENTED_FEATURES:
min_version, max_version = version.split('-') raise SkipTest(skip.get('reason', 'Feature %s is not supported' % skip['features']))
min_version = _get_version(min_version)
max_version = _get_version(max_version) if 'version' in skip:
if min_version <= self.es_version <= max_version: version, reason = skip['version'], skip['reason']
raise SkipTest(reason) min_version, max_version = version.split('-')
min_version = _get_version(min_version)
max_version = _get_version(max_version)
if min_version <= self.es_version <= max_version:
raise SkipTest(reason)
def run_catch(self, catch, exception): def run_catch(self, catch, exception):
if catch == 'param': if catch == 'param':