summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-02-18 03:33:25 +0100
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-02-20 17:13:52 +0100
commit7a61e36919ef3597c41c9bf5a77d8762bd1b9cf0 (patch)
tree0f6db1c1e74d1b04083a2f19b9530f6cbb9694b6
parentc48a8d56d8d469465df5c44a7715062bf8c6f313 (diff)
downloadopenshift-7a61e36919ef3597c41c9bf5a77d8762bd1b9cf0.tar.gz
openshift-7a61e36919ef3597c41c9bf5a77d8762bd1b9cf0.tar.bz2
openshift-7a61e36919ef3597c41c9bf5a77d8762bd1b9cf0.tar.xz
openshift-7a61e36919ef3597c41c9bf5a77d8762bd1b9cf0.zip
Move similar test cases together
And reorganize them in such a way to show that there are a bunch of duplicated tests that are exactly the same.
-rw-r--r--roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py64
-rw-r--r--roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py64
2 files changed, 64 insertions, 64 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 94c4495c9..c7cf73523 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,11 +98,43 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
}
@raises(AnsibleError)
+ def test_missing_openshift_facts(self):
+ facts = {}
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
+ def test_missing_deployment_type(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '10.10'
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
def test_missing_short_version_and_missing_openshift_release(self):
facts = copy.deepcopy(self.default_facts)
facts['openshift']['common']['deployment_type'] = 'origin'
self.lookup.run(None, variables=facts)
+ @raises(AnsibleError)
+ def test_unknown_deployment_types(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '1.1'
+ facts['openshift']['common']['deployment_type'] = 'bogus'
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
+ def test_unknown_origin_version(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '0.1'
+ facts['openshift']['common']['deployment_type'] = 'origin'
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
+ def test_unknown_ocp_version(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '0.1'
+ facts['openshift']['common']['deployment_type'] = 'openshift-enterprise'
+ self.lookup.run(None, variables=facts)
+
def check_defaults_short_version(self, short_version, deployment_type, default_predicates,
regions_enabled):
facts = copy.deepcopy(self.default_facts)
@@ -215,35 +247,3 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
for release, deployment_type, default_predicates in TEST_VARS:
release = release + '.1'
yield self.check_defaults_release, release, deployment_type, default_predicates, False
-
- @raises(AnsibleError)
- def test_unknown_deployment_types(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '1.1'
- facts['openshift']['common']['deployment_type'] = 'bogus'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_unknown_origin_version(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '0.1'
- facts['openshift']['common']['deployment_type'] = 'origin'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_unknown_ocp_version(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '0.1'
- facts['openshift']['common']['deployment_type'] = 'openshift-enterprise'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_missing_deployment_type(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '10.10'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_missing_openshift_facts(self):
- facts = {}
- self.lookup.run(None, variables=facts)
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 0bcd240d6..36d159f4a 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,11 +86,43 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
}
@raises(AnsibleError)
+ def test_missing_openshift_facts(self):
+ facts = {}
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
+ def test_missing_deployment_type(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '10.10'
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
def test_missing_short_version_and_missing_openshift_release(self):
facts = copy.deepcopy(self.default_facts)
facts['openshift']['common']['deployment_type'] = 'origin'
self.lookup.run(None, variables=facts)
+ @raises(AnsibleError)
+ def test_unknown_deployment_types(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '1.1'
+ facts['openshift']['common']['deployment_type'] = 'bogus'
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
+ def test_unknown_origin_version(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '0.1'
+ facts['openshift']['common']['deployment_type'] = 'origin'
+ self.lookup.run(None, variables=facts)
+
+ @raises(AnsibleError)
+ def test_unknown_ocp_version(self):
+ facts = copy.deepcopy(self.default_facts)
+ facts['openshift']['common']['short_version'] = '0.1'
+ facts['openshift']['common']['deployment_type'] = 'openshift-enterprise'
+ self.lookup.run(None, variables=facts)
+
def check_defaults_short_version(self, release, deployment_type,
default_priorities, zones_enabled):
facts = copy.deepcopy(self.default_facts)
@@ -201,35 +233,3 @@ class TestOpenShiftMasterFactsDefaultPredicates(object):
for release, deployment_type, default_priorities in TEST_VARS:
release = release + '.1'
yield self.check_defaults_release, release, deployment_type, default_priorities, False
-
- @raises(AnsibleError)
- def test_unknown_origin_version(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '0.1'
- facts['openshift']['common']['deployment_type'] = 'origin'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_unknown_ocp_version(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '0.1'
- facts['openshift']['common']['deployment_type'] = 'openshift-enterprise'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_unknown_deployment_types(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '1.1'
- facts['openshift']['common']['deployment_type'] = 'bogus'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_missing_deployment_type(self):
- facts = copy.deepcopy(self.default_facts)
- facts['openshift']['common']['short_version'] = '10.10'
- self.lookup.run(None, variables=facts)
-
- @raises(AnsibleError)
- def test_missing_openshift_facts(self):
- facts = {}
- self.lookup.run(None, variables=facts)