From e74e39c1894019029d5988d3b2a14c0c9234a222 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 13:49:31 +0200 Subject: [PATCH] Added CLI command test cases --- src/tests/unittests/application.py | 7 ++-- src/tests/unittests/test_case.py | 10 ------ src/tests/unittests_cli/add_test_case.py | 10 ++++++ src/tests/unittests_cli/build_test_case.py | 10 ++++++ src/tests/unittests_cli/cli_test_suite.py | 34 +++++++++++++++++++ src/tests/unittests_cli/custom_test_case.py | 10 ++++++ src/tests/unittests_cli/generate_test_case.py | 10 ++++++ src/tests/unittests_cli/install_test_case.py | 10 ++++++ src/tests/unittests_cli/new_test_case.py | 10 ++++++ src/tests/unittests_cli/publish_test_case.py | 10 ++++++ src/tests/unittests_cli/remove_test_case.py | 10 ++++++ src/tests/unittests_cli/run_test_case.py | 10 ++++++ src/tests/unittests_cli/start_test_case.py | 10 ++++++ .../unittests_cli/uninstall_test_case.py | 10 ++++++ src/tests/unittests_cli/update_test_case.py | 10 ++++++ src/tests/unittests_cli/version_test_case.py | 10 ++++++ 16 files changed, 167 insertions(+), 14 deletions(-) delete mode 100644 src/tests/unittests/test_case.py create mode 100644 src/tests/unittests_cli/add_test_case.py create mode 100644 src/tests/unittests_cli/build_test_case.py create mode 100644 src/tests/unittests_cli/cli_test_suite.py create mode 100644 src/tests/unittests_cli/custom_test_case.py create mode 100644 src/tests/unittests_cli/generate_test_case.py create mode 100644 src/tests/unittests_cli/install_test_case.py create mode 100644 src/tests/unittests_cli/new_test_case.py create mode 100644 src/tests/unittests_cli/publish_test_case.py create mode 100644 src/tests/unittests_cli/remove_test_case.py create mode 100644 src/tests/unittests_cli/run_test_case.py create mode 100644 src/tests/unittests_cli/start_test_case.py create mode 100644 src/tests/unittests_cli/uninstall_test_case.py create mode 100644 src/tests/unittests_cli/update_test_case.py create mode 100644 src/tests/unittests_cli/version_test_case.py diff --git a/src/tests/unittests/application.py b/src/tests/unittests/application.py index a3bd8cdb..105f0a8c 100644 --- a/src/tests/unittests/application.py +++ b/src/tests/unittests/application.py @@ -4,18 +4,17 @@ from unittest import TestSuite from cpl_core.application import ApplicationABC from cpl_core.configuration import ConfigurationABC from cpl_core.dependency_injection import ServiceProviderABC -from unittests.test_case import TestCase +from unittests_cli.cli_test_suite import CLITestSuite class Application(ApplicationABC): def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): ApplicationABC.__init__(self, config, services) - self._suite: TestSuite = unittest.TestSuite() def configure(self): - self._suite.addTest(TestCase('test_equal')) + pass def main(self): runner = unittest.TextTestRunner() - runner.run(self._suite) + runner.run(CLITestSuite()) diff --git a/src/tests/unittests/test_case.py b/src/tests/unittests/test_case.py deleted file mode 100644 index 0e4dad56..00000000 --- a/src/tests/unittests/test_case.py +++ /dev/null @@ -1,10 +0,0 @@ -import unittest - - -class TestCase(unittest.TestCase): - - def setUp(self) -> None: - pass - - def test_equal(self): - self.assertEqual(True, True) diff --git a/src/tests/unittests_cli/add_test_case.py b/src/tests/unittests_cli/add_test_case.py new file mode 100644 index 00000000..c2f493b3 --- /dev/null +++ b/src/tests/unittests_cli/add_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class AddTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/build_test_case.py b/src/tests/unittests_cli/build_test_case.py new file mode 100644 index 00000000..2456c099 --- /dev/null +++ b/src/tests/unittests_cli/build_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class BuildTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/cli_test_suite.py b/src/tests/unittests_cli/cli_test_suite.py new file mode 100644 index 00000000..eda27da3 --- /dev/null +++ b/src/tests/unittests_cli/cli_test_suite.py @@ -0,0 +1,34 @@ +import unittest + +from unittests_cli.add_test_case import AddTestCase +from unittests_cli.build_test_case import BuildTestCase +from unittests_cli.generate_test_case import GenerateTestCase +from unittests_cli.install_test_case import InstallTestCase +from unittests_cli.new_test_case import NewTestCase +from unittests_cli.publish_test_case import PublishTestCase +from unittests_cli.remove_test_case import RemoveTestCase +from unittests_cli.run_test_case import RunTestCase +from unittests_cli.start_test_case import StartTestCase +from unittests_cli.uninstall_test_case import UninstallTestCase +from unittests_cli.update_test_case import UpdateTestCase +from unittests_cli.version_test_case import VersionTestCase + + +class CLITestSuite(unittest.TestSuite): + + def __init__(self): + unittest.TestSuite.__init__(self) + + loader = unittest.TestLoader() + self.addTests(loader.loadTestsFromTestCase(AddTestCase)) + self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) + self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) + self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) + self.addTests(loader.loadTestsFromTestCase(NewTestCase)) + self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) + self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) + self.addTests(loader.loadTestsFromTestCase(RunTestCase)) + self.addTests(loader.loadTestsFromTestCase(StartTestCase)) + self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) + self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) + self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) diff --git a/src/tests/unittests_cli/custom_test_case.py b/src/tests/unittests_cli/custom_test_case.py new file mode 100644 index 00000000..db59be7d --- /dev/null +++ b/src/tests/unittests_cli/custom_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class CustomTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/generate_test_case.py b/src/tests/unittests_cli/generate_test_case.py new file mode 100644 index 00000000..e525695a --- /dev/null +++ b/src/tests/unittests_cli/generate_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class GenerateTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/install_test_case.py b/src/tests/unittests_cli/install_test_case.py new file mode 100644 index 00000000..0271f37b --- /dev/null +++ b/src/tests/unittests_cli/install_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class InstallTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/new_test_case.py b/src/tests/unittests_cli/new_test_case.py new file mode 100644 index 00000000..d902e011 --- /dev/null +++ b/src/tests/unittests_cli/new_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class NewTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/publish_test_case.py b/src/tests/unittests_cli/publish_test_case.py new file mode 100644 index 00000000..bad55d55 --- /dev/null +++ b/src/tests/unittests_cli/publish_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class PublishTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/remove_test_case.py b/src/tests/unittests_cli/remove_test_case.py new file mode 100644 index 00000000..a600c283 --- /dev/null +++ b/src/tests/unittests_cli/remove_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class RemoveTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/run_test_case.py b/src/tests/unittests_cli/run_test_case.py new file mode 100644 index 00000000..7ace1dd2 --- /dev/null +++ b/src/tests/unittests_cli/run_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class RunTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/start_test_case.py b/src/tests/unittests_cli/start_test_case.py new file mode 100644 index 00000000..8da691da --- /dev/null +++ b/src/tests/unittests_cli/start_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class StartTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/uninstall_test_case.py b/src/tests/unittests_cli/uninstall_test_case.py new file mode 100644 index 00000000..f3d1ae15 --- /dev/null +++ b/src/tests/unittests_cli/uninstall_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class UninstallTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/update_test_case.py b/src/tests/unittests_cli/update_test_case.py new file mode 100644 index 00000000..35e6d8f3 --- /dev/null +++ b/src/tests/unittests_cli/update_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class UpdateTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/version_test_case.py b/src/tests/unittests_cli/version_test_case.py new file mode 100644 index 00000000..cd7e75e9 --- /dev/null +++ b/src/tests/unittests_cli/version_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class VersionTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass