diff --git a/.gitignore b/.gitignore index e70c7f1..c463a60 100644 --- a/.gitignore +++ b/.gitignore @@ -37,5 +37,8 @@ tools/lintstack.head.py tools/pylint_exceptions *.zip -#Linux swap file +# Linux swap file *.swp + +# Tests results +.tox diff --git a/tox.ini b/tox.ini index ba29b4f..5d75a15 100644 --- a/tox.ini +++ b/tox.ini @@ -31,3 +31,7 @@ deps= ipdb -r{toxinidir}/test-requirements.txt commands = python -m unittest tests.test_cicd_apps.MuranoCiCdTest.test_deploy_cicd + +[testenv:units] +# FIXME! +commands = python -m unittest unittests.test_namespaces.TestNamespaces.test_namespaces diff --git a/unittests/__init__.py b/unittests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/unittests/test_namespaces.py b/unittests/test_namespaces.py index 599a56e..2537507 100644 --- a/unittests/test_namespaces.py +++ b/unittests/test_namespaces.py @@ -2,8 +2,10 @@ import os import re import yaml +import testtools -class TestNamespaces(): + +class TestNamespaces(testtools.TestCase): def get_list_of_classes(self): # TODO: should be fixed future with some common approach for all tests root_dir = os.path.dirname(os.path.abspath(__file__)).rsplit('/', 1)[0] @@ -63,16 +65,7 @@ class TestNamespaces(): for ns in self.get_namespaces(cls_name): self.check_name(ns, cls_name, error_list) - if error_list: - error_string = "\n".join(error_list) - msg = "Test detects follow list of errors: \n%s" % error_string - raise ValueError(msg) + error_string = "\n".join(error_list) + msg = "Test detects follow list of errors: \n%s" % error_string - -def main(): - test = TestNamespaces() - test.test_namespaces() - -# to run test just execute command: -# python unittests/test_namespaces.py -main() + self.assertEqual(0, len(error_list), msg)