summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-02-18 17:37:07 +0100
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-02-20 17:13:52 +0100
commite7b4e49247097323d0ef07b5ca63759b5ab502ee (patch)
treeab2373a7090c6ac8d44e62d81b83685a663ab4e1
parent8c0c5384341fb0a0ab70b4770c44a799178c90af (diff)
downloadopenshift-e7b4e49247097323d0ef07b5ca63759b5ab502ee.tar.gz
openshift-e7b4e49247097323d0ef07b5ca63759b5ab502ee.tar.bz2
openshift-e7b4e49247097323d0ef07b5ca63759b5ab502ee.tar.xz
openshift-e7b4e49247097323d0ef07b5ca63759b5ab502ee.zip
Make usage of short_version/release consistent
This removes irrelevant differences between the two test files, making it easier to observe similarities.
-rw-r--r--roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py22
-rw-r--r--roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py31
2 files changed, 26 insertions, 27 deletions
diff --git a/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py b/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py
index a33c183f6..1d6de616a 100644
--- a/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py
+++ b/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py
@@ -98,9 +98,9 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
def test_openshift_version(self):
for regions_enabled in (True, False):
- for release, deployment_type, default_predicates in TEST_VARS:
- release = release + '.1'
- yield self.check_defaults_version, release, deployment_type, default_predicates, regions_enabled
+ for version, deployment_type, default_predicates in TEST_VARS:
+ version = version + '.1'
+ yield self.check_defaults_version, version, deployment_type, default_predicates, regions_enabled
def check_defaults_version(self, version, deployment_type, default_predicates,
regions_enabled):
@@ -143,8 +143,8 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
def test_short_version_defaults(self):
for regions_enabled in (True, False):
- for release, deployment_type, default_predicates in TEST_VARS:
- yield self.check_defaults_short_version, release, deployment_type, default_predicates, regions_enabled
+ for short_version, deployment_type, default_predicates in TEST_VARS:
+ yield self.check_defaults_short_version, short_version, deployment_type, default_predicates, regions_enabled
def check_defaults_short_version(self, short_version, deployment_type, default_predicates,
regions_enabled):
@@ -160,8 +160,8 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
def test_short_version_kwarg(self):
for regions_enabled in (True, False):
- for release, deployment_type, default_predicates in TEST_VARS:
- yield self.check_defaults_short_version_kwarg, release, deployment_type, default_predicates, regions_enabled
+ for short_version, deployment_type, default_predicates in TEST_VARS:
+ yield self.check_defaults_short_version_kwarg, short_version, deployment_type, default_predicates, regions_enabled
def check_defaults_short_version_kwarg(self, short_version, deployment_type, default_predicates,
regions_enabled):
@@ -177,8 +177,8 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
def test_deployment_type_kwarg(self):
for regions_enabled in (True, False):
- for release, deployment_type, default_predicates in TEST_VARS:
- yield self.check_defaults_deployment_type_kwarg, release, deployment_type, default_predicates, regions_enabled
+ for short_version, deployment_type, default_predicates in TEST_VARS:
+ yield self.check_defaults_deployment_type_kwarg, short_version, deployment_type, default_predicates, regions_enabled
def check_defaults_deployment_type_kwarg(self, short_version, deployment_type,
default_predicates, regions_enabled):
@@ -194,8 +194,8 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
def test_only_kwargs(self):
for regions_enabled in (True, False):
- for release, deployment_type, default_predicates in TEST_VARS:
- yield self.check_defaults_only_kwargs, release, deployment_type, default_predicates, regions_enabled
+ for short_version, deployment_type, default_predicates in TEST_VARS:
+ yield self.check_defaults_only_kwargs, short_version, deployment_type, default_predicates, regions_enabled
def check_defaults_only_kwargs(self, short_version, deployment_type,
default_predicates, regions_enabled):
diff --git a/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py b/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py
index 326af3e13..32edc4c34 100644
--- a/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py
+++ b/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py
@@ -86,14 +86,14 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
def test_openshift_version(self):
for zones_enabled in (True, False):
- for release, deployment_type, default_priorities in TEST_VARS:
- release = release + '.1'
- yield self.check_defaults_version, release, deployment_type, default_priorities, zones_enabled
+ for version, deployment_type, default_priorities in TEST_VARS:
+ version = version + '.1'
+ yield self.check_defaults_version, version, deployment_type, default_priorities, zones_enabled
- def check_defaults_version(self, release, deployment_type, default_priorities,
+ def check_defaults_version(self, version, deployment_type, default_priorities,
zones_enabled):
facts = copy.deepcopy(self.default_facts)
- facts['openshift_version'] = release
+ facts['openshift_version'] = version
facts['openshift']['common']['deployment_type'] = deployment_type
results = self.lookup.run(None, variables=facts, zones_enabled=zones_enabled)
if zones_enabled:
@@ -109,8 +109,7 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
def test_v_release_defaults(self):
for zones_enabled in (True, False):
for release, deployment_type, default_priorities in TEST_VARS:
- release = 'v' + release
- yield self.check_defaults_release, release, deployment_type, default_priorities, zones_enabled
+ yield self.check_defaults_release, 'v' + release, deployment_type, default_priorities, zones_enabled
def test_trunc_openshift_release(self):
for release, deployment_type, default_priorities in TEST_VARS:
@@ -133,10 +132,10 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
for short_version, deployment_type, default_priorities in TEST_VARS:
yield self.check_defaults_short_version, short_version, deployment_type, default_priorities, zones_enabled
- def check_defaults_short_version(self, release, deployment_type,
+ def check_defaults_short_version(self, short_version, deployment_type,
default_priorities, zones_enabled):
facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = release
+ facts['openshift']['common']['short_version'] = short_version
facts['openshift']['common']['deployment_type'] = deployment_type
results = self.lookup.run(None, variables=facts, zones_enabled=zones_enabled)
if zones_enabled:
@@ -144,18 +143,18 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
else:
assert_equal(results, default_priorities)
- def test_release_kwarg(self):
+ def test_short_version_kwarg(self):
for zones_enabled in (True, False):
for short_version, deployment_type, default_priorities in TEST_VARS:
yield self.check_defaults_short_version_kwarg, short_version, deployment_type, default_priorities, zones_enabled
- def check_defaults_short_version_kwarg(self, release, deployment_type,
+ def check_defaults_short_version_kwarg(self, short_version, deployment_type,
default_priorities, zones_enabled):
facts = copy.deepcopy(self.default_facts)
facts['openshift']['common']['deployment_type'] = deployment_type
results = self.lookup.run(None, variables=facts,
zones_enabled=zones_enabled,
- short_version=release)
+ short_version=short_version)
if zones_enabled:
assert_equal(results, default_priorities + [ZONE_PRIORITY])
else:
@@ -166,10 +165,10 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
for short_version, deployment_type, default_priorities in TEST_VARS:
yield self.check_defaults_deployment_type_kwarg, short_version, deployment_type, default_priorities, zones_enabled
- def check_defaults_deployment_type_kwarg(self, release, deployment_type,
+ def check_defaults_deployment_type_kwarg(self, short_version, deployment_type,
default_priorities, zones_enabled):
facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = release
+ facts['openshift']['common']['short_version'] = short_version
results = self.lookup.run(None, variables=facts,
zones_enabled=zones_enabled,
deployment_type=deployment_type)
@@ -183,12 +182,12 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
for short_version, deployment_type, default_priorities in TEST_VARS:
yield self.check_defaults_only_kwargs, short_version, deployment_type, default_priorities, zones_enabled
- def check_defaults_only_kwargs(self, release, deployment_type,
+ def check_defaults_only_kwargs(self, short_version, deployment_type,
default_priorities, zones_enabled):
facts = copy.deepcopy(self.default_facts)
results = self.lookup.run(None, variables=facts,
zones_enabled=zones_enabled,
- short_version=release,
+ short_version=short_version,
deployment_type=deployment_type)
if zones_enabled:
assert_equal(results, default_priorities + [ZONE_PRIORITY])