Registered CLI test cases

This commit is contained in:
Sven Heidemann 2022-05-26 13:59:46 +02:00
parent e74e39c189
commit 46cceb0910

View File

@ -1,3 +1,5 @@
import os
import traceback
import unittest import unittest
from unittests_cli.add_test_case import AddTestCase from unittests_cli.add_test_case import AddTestCase
@ -19,16 +21,44 @@ class CLITestSuite(unittest.TestSuite):
def __init__(self): def __init__(self):
unittest.TestSuite.__init__(self) unittest.TestSuite.__init__(self)
self._setup()
loader = unittest.TestLoader() loader = unittest.TestLoader()
self.addTests(loader.loadTestsFromTestCase(AddTestCase)) # nothing needed
self.addTests(loader.loadTestsFromTestCase(BuildTestCase))
self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) self.addTests(loader.loadTestsFromTestCase(GenerateTestCase))
self.addTests(loader.loadTestsFromTestCase(InstallTestCase))
self.addTests(loader.loadTestsFromTestCase(NewTestCase)) self.addTests(loader.loadTestsFromTestCase(NewTestCase))
self.addTests(loader.loadTestsFromTestCase(VersionTestCase))
# project needed
self.addTests(loader.loadTestsFromTestCase(BuildTestCase))
self.addTests(loader.loadTestsFromTestCase(InstallTestCase))
self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) self.addTests(loader.loadTestsFromTestCase(PublishTestCase))
self.addTests(loader.loadTestsFromTestCase(RemoveTestCase))
self.addTests(loader.loadTestsFromTestCase(RunTestCase)) self.addTests(loader.loadTestsFromTestCase(RunTestCase))
self.addTests(loader.loadTestsFromTestCase(StartTestCase)) self.addTests(loader.loadTestsFromTestCase(StartTestCase))
self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) self.addTests(loader.loadTestsFromTestCase(UninstallTestCase))
self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) self.addTests(loader.loadTestsFromTestCase(UpdateTestCase))
self.addTests(loader.loadTestsFromTestCase(VersionTestCase))
# workspace needed
self.addTests(loader.loadTestsFromTestCase(AddTestCase))
self.addTests(loader.loadTestsFromTestCase(RemoveTestCase))
self._cleanup()
def _setup(self):
try:
playground = os.path.abspath(os.path.join(os.getcwd(), 'test_cli_playground'))
if os.path.exists(playground):
os.rmdir(playground)
os.mkdir(playground)
os.chdir(playground)
except Exception as e:
print(f'Setup of {__name__} failed: {traceback.format_exc()}')
def _cleanup(self):
try:
playground = os.path.abspath(os.path.join(os.getcwd(), 'test_cli_playground'))
if os.path.exists(playground):
os.rmdir(playground)
except Exception as e:
print(f'Cleanup of {__name__} failed: {traceback.format_exc()}')