summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oadm_manage_node.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_env.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_label.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_objectvalidator.py13
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_process.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_project.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_route.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_scale.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_secret.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_service.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_serviceaccount.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py20
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_version.py20
-rwxr-xr-xroles/lib_utils/src/test/unit/test_repoquery.py20
-rwxr-xr-xroles/lib_utils/src/test/unit/test_yedit.py12
-rw-r--r--utils/test/oo_config_tests.py39
16 files changed, 0 insertions, 324 deletions
diff --git a/roles/lib_openshift/src/test/unit/test_oadm_manage_node.py b/roles/lib_openshift/src/test/unit/test_oadm_manage_node.py
index 761c849fb..27d98b869 100755
--- a/roles/lib_openshift/src/test/unit/test_oadm_manage_node.py
+++ b/roles/lib_openshift/src/test/unit/test_oadm_manage_node.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oadm_manage_node
'''
-# To run
-# python -m unittest version
-#
-# .
-# Ran 2 tests in 0.001s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class ManageNodeTest(unittest.TestCase):
Test class for oadm_manage_node
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oadm_manage_node.Utils.create_tmpfile_copy')
@mock.patch('oadm_manage_node.ManageNode.openshift_cmd')
def test_list_pods(self, mock_openshift_cmd, mock_tmpfile_copy):
@@ -287,11 +275,3 @@ class ManageNodeTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_env.py b/roles/lib_openshift/src/test/unit/test_oc_env.py
index 45a3ef1eb..2f416c05e 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_env.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_env.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc_env
'''
-# To run:
-# ./oc_env.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class OCEnvTest(unittest.TestCase):
Test class for OCEnv
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_env.locate_oc_binary')
@mock.patch('oc_env.Utils.create_tmpfile_copy')
@mock.patch('oc_env.OCEnv._run')
@@ -558,11 +546,3 @@ class OCEnvTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_label.py b/roles/lib_openshift/src/test/unit/test_oc_label.py
index 933b5f221..5453266c1 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_label.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_label.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc label
'''
-# To run
-# python -m unittest version
-#
-# .
-# Ran 1 test in 0.597s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class OCLabelTest(unittest.TestCase):
Test class for OCLabel
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_label.Utils.create_tmpfile_copy')
@mock.patch('oc_label.OCLabel._run')
def test_state_list(self, mock_cmd, mock_tmpfile_copy):
@@ -295,11 +283,3 @@ class OCLabelTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_objectvalidator.py b/roles/lib_openshift/src/test/unit/test_oc_objectvalidator.py
index 8235c71b8..a97d0493e 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_objectvalidator.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_objectvalidator.py
@@ -1,15 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc_objectvalidator
'''
-# To run
-# ./oc_objectvalidator.py.py
-#
-# ....
-# ----------------------------------------------------------------------
-# Ran 4 tests in 0.002s
-#
-# OK
import os
import sys
@@ -910,7 +901,3 @@ class OCObjectValidatorTest(unittest.TestCase):
mock.call(['oc', 'get', 'netnamespace', '-o', 'json', '-n', 'default'], None),
mock.call(['oc', 'get', 'namespace', '-o', 'json', '-n', 'default'], None),
])
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_process.py b/roles/lib_openshift/src/test/unit/test_oc_process.py
index c4b36928b..d887f7636 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_process.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_process.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc process
'''
-# To run
-# python -m unittest version
-#
-# .
-# Ran 1 test in 0.597s
-#
-# OK
import os
import six
@@ -254,10 +246,6 @@ class OCProcessTest(unittest.TestCase):
}
}'''
- def setUp(self):
- ''' setup method will set to known configuration '''
- pass
-
@mock.patch('oc_process.Utils.create_tmpfile_copy')
@mock.patch('oc_process.OCProcess._run')
def test_state_list(self, mock_cmd, mock_tmpfile_copy):
@@ -582,11 +570,3 @@ class OCProcessTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_project.py b/roles/lib_openshift/src/test/unit/test_oc_project.py
index 50d81e6a6..5155101cb 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_project.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_project.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc project
'''
-# To run:
-# ./oc_secret.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import sys
@@ -31,10 +23,6 @@ class OCProjectTest(unittest.TestCase):
Test class for OCSecret
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_project.locate_oc_binary')
@mock.patch('oc_project.Utils.create_tmpfile_copy')
@mock.patch('oc_project.Utils._write')
@@ -120,11 +108,3 @@ class OCProjectTest(unittest.TestCase):
mock.call(['oc', 'get', 'namespace', 'operations', '-o', 'json'], None),
])
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_route.py b/roles/lib_openshift/src/test/unit/test_oc_route.py
index e0f6d2f3c..09c52a461 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_route.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_route.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc route
'''
-# To run:
-# ./oc_serviceaccount.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class OCRouteTest(unittest.TestCase):
Test class for OCServiceAccount
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_route.locate_oc_binary')
@mock.patch('oc_route.Utils.create_tmpfile_copy')
@mock.patch('oc_route.OCRoute._run')
@@ -377,11 +365,3 @@ metadata:
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_scale.py b/roles/lib_openshift/src/test/unit/test_oc_scale.py
index b2dec2fbe..d810735f2 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_scale.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_scale.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc scale
'''
-# To run
-# python -m unittest version
-#
-# .
-# Ran 1 test in 0.597s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class OCScaleTest(unittest.TestCase):
Test class for OCVersion
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_scale.Utils.create_tmpfile_copy')
@mock.patch('oc_scale.OCScale.openshift_cmd')
def test_state_list(self, mock_openshift_cmd, mock_tmpfile_copy):
@@ -266,11 +254,3 @@ class OCScaleTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_secret.py b/roles/lib_openshift/src/test/unit/test_oc_secret.py
index bf496769a..e31393793 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_secret.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_secret.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc secret
'''
-# To run:
-# ./oc_secret.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class OCSecretTest(unittest.TestCase):
Test class for OCSecret
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_secret.locate_oc_binary')
@mock.patch('oc_secret.Utils.create_tmpfile_copy')
@mock.patch('oc_secret.Utils._write')
@@ -200,11 +188,3 @@ class OCSecretTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_service.py b/roles/lib_openshift/src/test/unit/test_oc_service.py
index 8974eb6c6..e74c66665 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_service.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_service.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc service
'''
-# To run
-# python -m unittest version
-#
-# .
-# Ran 1 test in 0.597s
-#
-# OK
import os
import six
@@ -33,10 +25,6 @@ class OCServiceTest(unittest.TestCase):
Test class for OCService
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_service.Utils.create_tmpfile_copy')
@mock.patch('oc_service.OCService._run')
def test_state_list(self, mock_cmd, mock_tmpfile_copy):
@@ -315,11 +303,3 @@ class OCServiceTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py
index 3572a6728..5772d2f00 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc serviceaccount
'''
-# To run:
-# ./oc_serviceaccount.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class OCServiceAccountTest(unittest.TestCase):
Test class for OCServiceAccount
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_serviceaccount.locate_oc_binary')
@mock.patch('oc_serviceaccount.Utils.create_tmpfile_copy')
@mock.patch('oc_serviceaccount.OCServiceAccount._run')
@@ -223,11 +211,3 @@ class OCServiceAccountTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
index d78349e34..b22525068 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc secret add
'''
-# To run:
-# ./oc_serviceaccount_secret.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import six
@@ -38,10 +30,6 @@ class OCServiceAccountSecretTest(unittest.TestCase):
Test class for OCServiceAccountSecret
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_serviceaccount_secret.locate_oc_binary')
@mock.patch('oc_serviceaccount_secret.Utils.create_tmpfile_copy')
@mock.patch('oc_serviceaccount_secret.Yedit._write')
@@ -424,11 +412,3 @@ secrets:
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_openshift/src/test/unit/test_oc_version.py b/roles/lib_openshift/src/test/unit/test_oc_version.py
index 6daf5b00d..c287bad0b 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_version.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_version.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc version
'''
-# To run
-# python -m unittest version
-#
-# .
-# Ran 1 test in 0.597s
-#
-# OK
import os
import six
@@ -32,10 +24,6 @@ class OCVersionTest(unittest.TestCase):
Test class for OCVersion
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_version.Utils.create_tmpfile_copy')
@mock.patch('oc_version.OCVersion.openshift_cmd')
def test_get(self, mock_openshift_cmd, mock_tmpfile_copy):
@@ -172,11 +160,3 @@ class OCVersionTest(unittest.TestCase):
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_utils/src/test/unit/test_repoquery.py b/roles/lib_utils/src/test/unit/test_repoquery.py
index c487ab254..e39d9d83f 100755
--- a/roles/lib_utils/src/test/unit/test_repoquery.py
+++ b/roles/lib_utils/src/test/unit/test_repoquery.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for repoquery
'''
-# To run:
-# ./repoquery.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import sys
@@ -31,10 +23,6 @@ class RepoQueryTest(unittest.TestCase):
Test class for RepoQuery
'''
- def setUp(self):
- ''' setup method for other tests '''
- pass
-
@mock.patch('repoquery._run')
def test_querying_a_package(self, mock_cmd):
''' Testing querying a package '''
@@ -77,11 +65,3 @@ class RepoQueryTest(unittest.TestCase):
mock_cmd.assert_has_calls([
mock.call(['/usr/bin/repoquery', '--plugins', '--quiet', '--pkgnarrow=repos', '--queryformat=%{version}|%{release}|%{arch}|%{repo}|%{version}-%{release}', 'bash']),
])
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/roles/lib_utils/src/test/unit/test_yedit.py b/roles/lib_utils/src/test/unit/test_yedit.py
index a22cdee56..23a3f7353 100755
--- a/roles/lib_utils/src/test/unit/test_yedit.py
+++ b/roles/lib_utils/src/test/unit/test_yedit.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for yedit
'''
-# To run
-# python -m unittest yedit_test
-#
-# .............................
-# ----------------------------------------------------------------------
-# Ran 29 tests in 0.133s
-# OK
import os
import sys
@@ -288,7 +280,3 @@ class YeditTest(unittest.TestCase):
def tearDown(self):
'''TearDown method'''
os.unlink(YeditTest.filename)
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/utils/test/oo_config_tests.py b/utils/test/oo_config_tests.py
index 2b4fce512..5651e6e7a 100644
--- a/utils/test/oo_config_tests.py
+++ b/utils/test/oo_config_tests.py
@@ -266,42 +266,3 @@ class HostTests(OOInstallFixture):
self.assertIn(node_labels_expected, legacy_inventory_line)
# An unquoted version is not present
self.assertNotIn(node_labels_bad, legacy_inventory_line)
-
-
- # def test_new_write_inventory_same_as_legacy(self):
- # """Verify the original write_host function produces the same output as the new method"""
- # yaml_props = {
- # 'ip': '192.168.0.1',
- # 'hostname': 'a.example.com',
- # 'connect_to': 'a-private.example.com',
- # 'public_ip': '192.168.0.1',
- # 'public_hostname': 'a.example.com',
- # 'new_host': True,
- # 'roles': ['node'],
- # 'other_variables': {
- # 'zzz': 'last',
- # 'foo': 'bar',
- # 'aaa': 'first',
- # },
- # }
-
- # new_node = Host(**yaml_props)
- # inventory = cStringIO()
-
- # # This is what the original 'write_host' function will
- # # generate. write_host has no return value, it just writes
- # # directly to the file 'inventory' which in this test-case is
- # # a StringIO object
- # ooinstall.openshift_ansible.write_host(
- # new_node,
- # 'node',
- # inventory,
- # schedulable=True)
- # legacy_inventory_line = inventory.getvalue()
-
- # # This is what the new method in the Host class generates
- # new_inventory_line = new_node.inventory_string('node', schedulable=True)
-
- # self.assertEqual(
- # legacy_inventory_line,
- # new_inventory_line)