Merge "Run unittests via tox"
This commit is contained in:
commit
95f75bcbce
5
.gitignore
vendored
5
.gitignore
vendored
@ -37,5 +37,8 @@ tools/lintstack.head.py
|
||||
tools/pylint_exceptions
|
||||
*.zip
|
||||
|
||||
#Linux swap file
|
||||
# Linux swap file
|
||||
*.swp
|
||||
|
||||
# Tests results
|
||||
.tox
|
||||
|
4
tox.ini
4
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
|
||||
|
0
unittests/__init__.py
Normal file
0
unittests/__init__.py
Normal file
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user