|
@@ -80,15 +80,19 @@ TEST_VARS = [
|
|
|
]
|
|
|
|
|
|
|
|
|
-def test_openshift_version(predicates_lookup, openshift_version_fixture, regions_enabled):
|
|
|
- facts, default_predicates = openshift_version_fixture
|
|
|
- results = predicates_lookup.run(None, variables=facts, regions_enabled=regions_enabled)
|
|
|
+def assert_ok(predicates_lookup, default_predicates, regions_enabled, **kwargs):
|
|
|
+ results = predicates_lookup.run(None, regions_enabled=regions_enabled, **kwargs)
|
|
|
if regions_enabled:
|
|
|
assert results == default_predicates + [REGION_PREDICATE]
|
|
|
else:
|
|
|
assert results == default_predicates
|
|
|
|
|
|
|
|
|
+def test_openshift_version(predicates_lookup, openshift_version_fixture, regions_enabled):
|
|
|
+ facts, default_predicates = openshift_version_fixture
|
|
|
+ assert_ok(predicates_lookup, default_predicates, variables=facts, regions_enabled=regions_enabled)
|
|
|
+
|
|
|
+
|
|
|
@pytest.fixture(params=TEST_VARS)
|
|
|
def openshift_version_fixture(request, facts):
|
|
|
version, deployment_type, default_predicates = request.param
|
|
@@ -100,11 +104,7 @@ def openshift_version_fixture(request, facts):
|
|
|
|
|
|
def test_openshift_release(predicates_lookup, openshift_release_fixture, regions_enabled):
|
|
|
facts, default_predicates = openshift_release_fixture
|
|
|
- results = predicates_lookup.run(None, variables=facts, regions_enabled=regions_enabled)
|
|
|
- if regions_enabled:
|
|
|
- assert results == default_predicates + [REGION_PREDICATE]
|
|
|
- else:
|
|
|
- assert results == default_predicates
|
|
|
+ assert_ok(predicates_lookup, default_predicates, variables=facts, regions_enabled=regions_enabled)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|
|
@@ -117,11 +117,7 @@ def openshift_release_fixture(request, facts, release_mod):
|
|
|
|
|
|
def test_short_version(predicates_lookup, short_version_fixture, regions_enabled):
|
|
|
facts, default_predicates = short_version_fixture
|
|
|
- results = predicates_lookup.run(None, variables=facts, regions_enabled=regions_enabled)
|
|
|
- if regions_enabled:
|
|
|
- assert results == default_predicates + [REGION_PREDICATE]
|
|
|
- else:
|
|
|
- assert results == default_predicates
|
|
|
+ assert_ok(predicates_lookup, default_predicates, variables=facts, regions_enabled=regions_enabled)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|
|
@@ -134,11 +130,7 @@ def short_version_fixture(request, facts):
|
|
|
|
|
|
def test_short_version_kwarg(predicates_lookup, short_version_kwarg_fixture, regions_enabled):
|
|
|
facts, short_version, default_predicates = short_version_kwarg_fixture
|
|
|
- results = predicates_lookup.run(None, variables=facts, regions_enabled=regions_enabled, short_version=short_version)
|
|
|
- if regions_enabled:
|
|
|
- assert results == default_predicates + [REGION_PREDICATE]
|
|
|
- else:
|
|
|
- assert results == default_predicates
|
|
|
+ assert_ok(predicates_lookup, default_predicates, variables=facts, regions_enabled=regions_enabled, short_version=short_version)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|
|
@@ -150,11 +142,7 @@ def short_version_kwarg_fixture(request, facts):
|
|
|
|
|
|
def test_deployment_type_kwarg(predicates_lookup, deployment_type_kwarg_fixture, regions_enabled):
|
|
|
facts, deployment_type, default_predicates = deployment_type_kwarg_fixture
|
|
|
- results = predicates_lookup.run(None, variables=facts, regions_enabled=regions_enabled, deployment_type=deployment_type)
|
|
|
- if regions_enabled:
|
|
|
- assert results == default_predicates + [REGION_PREDICATE]
|
|
|
- else:
|
|
|
- assert results == default_predicates
|
|
|
+ assert_ok(predicates_lookup, default_predicates, variables=facts, regions_enabled=regions_enabled, deployment_type=deployment_type)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|
|
@@ -166,11 +154,7 @@ def deployment_type_kwarg_fixture(request, facts):
|
|
|
|
|
|
def test_short_version_deployment_type_kwargs(predicates_lookup, short_version_deployment_type_kwargs_fixture, regions_enabled):
|
|
|
short_version, deployment_type, default_predicates = short_version_deployment_type_kwargs_fixture
|
|
|
- results = predicates_lookup.run(None, regions_enabled=regions_enabled, short_version=short_version, deployment_type=deployment_type)
|
|
|
- if regions_enabled:
|
|
|
- assert results == default_predicates + [REGION_PREDICATE]
|
|
|
- else:
|
|
|
- assert results == default_predicates
|
|
|
+ assert_ok(predicates_lookup, default_predicates, regions_enabled=regions_enabled, short_version=short_version, deployment_type=deployment_type)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|