Increase minimum version for v3.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2016-12-06 17:01:35 -05:00
parent 9bfb855b89
commit e04a12b5ca
3 changed files with 15 additions and 14 deletions

View File

@ -23,12 +23,12 @@ API_VERSIONS = {
COMPOSEFILE_V1: '1.21',
COMPOSEFILE_V2_0: '1.22',
COMPOSEFILE_V2_1: '1.24',
COMPOSEFILE_V3_0: '1.24',
COMPOSEFILE_V3_0: '1.25',
}
API_VERSION_TO_ENGINE_VERSION = {
API_VERSIONS[COMPOSEFILE_V1]: '1.9.0',
API_VERSIONS[COMPOSEFILE_V2_0]: '1.10.0',
API_VERSIONS[COMPOSEFILE_V2_1]: '1.12.0',
API_VERSIONS[COMPOSEFILE_V3_0]: '1.12.0',
API_VERSIONS[COMPOSEFILE_V3_0]: '1.13.0',
}

View File

@ -26,6 +26,7 @@ from tests.integration.testcases import get_links
from tests.integration.testcases import pull_busybox
from tests.integration.testcases import v2_1_only
from tests.integration.testcases import v2_only
from tests.integration.testcases import v3_only
ProcessResult = namedtuple('ProcessResult', 'stdout stderr')
@ -285,6 +286,7 @@ class CLITestCase(DockerClientTestCase):
'volumes': {},
}
@v3_only()
def test_config_v3(self):
self.base_dir = 'tests/fixtures/v3-full'
result = self.dispatch(['config'])

View File

@ -45,11 +45,11 @@ def engine_max_version():
return V2_1
def v2_only():
def build_version_required_decorator(ignored_versions):
def decorator(f):
@functools.wraps(f)
def wrapper(self, *args, **kwargs):
if engine_max_version() == V1:
if engine_max_version() in ignored_versions:
skip("Engine version is too low")
return
return f(self, *args, **kwargs)
@ -58,17 +58,16 @@ def v2_only():
return decorator
def v2_1_only():
def decorator(f):
@functools.wraps(f)
def wrapper(self, *args, **kwargs):
if engine_max_version() in (V1, V2_0):
skip('Engine version is too low')
return
return f(self, *args, **kwargs)
return wrapper
def v2_only():
return build_version_required_decorator((V1,))
return decorator
def v2_1_only():
return build_version_required_decorator((V1, V2_0))
def v3_only():
return build_version_required_decorator((V1, V2_0, V2_1))
class DockerClientTestCase(unittest.TestCase):