From df32978a31437435e41d81b7bc3e53ec89ee738d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 15:49:52 +0200 Subject: [PATCH] Moved unittests --- cpl-workspace.json | 10 ++++---- src/tests/__init__.py | 25 ------------------- .../tests => unittests}/unittests/__init__.py | 0 .../unittests/application.py | 0 {src/tests => unittests}/unittests/main.py | 0 .../unittests/unittests.json | 0 .../unittests_cli/__init__.py | 0 .../unittests_cli/add_test_case.py | 0 .../unittests_cli/build_test_case.py | 0 .../unittests_cli/cli_test_suite.py | 6 ++--- .../unittests_cli/constants.py | 2 +- .../unittests_cli/custom_test_case.py | 0 .../unittests_cli/generate_test_case.py | 0 .../unittests_cli/install_test_case.py | 0 .../unittests_cli/new_test_case.py | 0 .../unittests_cli/publish_test_case.py | 0 .../unittests_cli/remove_test_case.py | 0 .../unittests_cli/run_test_case.py | 0 .../unittests_cli/start_test_case.py | 0 .../unittests_cli/uninstall_test_case.py | 0 .../unittests_cli/unittests_cli.json | 0 .../unittests_cli/update_test_case.py | 0 .../unittests_cli/version_test_case.py | 0 .../unittests_core/__init__.py | 0 .../unittests_core/unittests_core.json | 0 .../unittests_query/__init__.py | 0 .../unittests_query/unittests_query.json | 0 .../unittests_shared/__init__.py | 0 .../unittests_shared/cli_commands.py | 0 .../unittests_shared/unittests_shared.json | 0 30 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 src/tests/__init__.py rename {src/tests => unittests}/unittests/__init__.py (100%) rename {src/tests => unittests}/unittests/application.py (100%) rename {src/tests => unittests}/unittests/main.py (100%) rename {src/tests => unittests}/unittests/unittests.json (100%) rename {src/tests => unittests}/unittests_cli/__init__.py (100%) rename {src/tests => unittests}/unittests_cli/add_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/build_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/cli_test_suite.py (92%) rename {src/tests => unittests}/unittests_cli/constants.py (56%) rename {src/tests => unittests}/unittests_cli/custom_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/generate_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/install_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/new_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/publish_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/remove_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/run_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/start_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/uninstall_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/unittests_cli.json (100%) rename {src/tests => unittests}/unittests_cli/update_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/version_test_case.py (100%) rename {src/tests => unittests}/unittests_core/__init__.py (100%) rename {src/tests => unittests}/unittests_core/unittests_core.json (100%) rename {src/tests => unittests}/unittests_query/__init__.py (100%) rename {src/tests => unittests}/unittests_query/unittests_query.json (100%) rename {src/tests => unittests}/unittests_shared/__init__.py (100%) rename {src/tests => unittests}/unittests_shared/cli_commands.py (100%) rename {src/tests => unittests}/unittests_shared/unittests_shared.json (100%) diff --git a/cpl-workspace.json b/cpl-workspace.json index cf6608bf..8d2d7423 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -7,11 +7,11 @@ "cpl-query": "src/cpl_query/cpl-query.json", "set-version": "tools/set_version/set-version.json", "set-pip-urls": "tools/set_pip_urls/set-pip-urls.json", - "unittests": "src/tests/unittests/unittests.json", - "unittests_cli": "src/tests/unittests_cli/unittests_cli.json", - "unittests_core": "src/tests/unittests_core/unittests_core.json", - "unittests_query": "src/tests/unittests_query/unittests_query.json", - "unittests_shared": "src/tests/unittests_shared/unittests_shared.json" + "unittests": "unittests/unittests/unittests.json", + "unittests_cli": "unittests/unittests_cli/unittests_cli.json", + "unittests_core": "unittests/unittests_core/unittests_core.json", + "unittests_query": "unittests/unittests_query/unittests_query.json", + "unittests_shared": "unittests/unittests_shared/unittests_shared.json" }, "Scripts": { "hello-world": "echo 'Hello World'", diff --git a/src/tests/__init__.py b/src/tests/__init__.py deleted file mode 100644 index 71ee2167..00000000 --- a/src/tests/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -sh_cpl sh-edraft Common Python library -~~~~~~~~~~~~~~~~~~~ - -sh-edraft Common Python library - -:copyright: (c) 2020 - 2021 sh-edraft.de -:license: MIT, see LICENSE for more details. - -""" - -__title__ = 'sh_cpl.tests' -__author__ = 'Sven Heidemann' -__license__ = 'MIT' -__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' -__version__ = '2021.4.1' - -from collections import namedtuple - -# imports: - -VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2021, minor=4, micro=1) diff --git a/src/tests/unittests/__init__.py b/unittests/unittests/__init__.py similarity index 100% rename from src/tests/unittests/__init__.py rename to unittests/unittests/__init__.py diff --git a/src/tests/unittests/application.py b/unittests/unittests/application.py similarity index 100% rename from src/tests/unittests/application.py rename to unittests/unittests/application.py diff --git a/src/tests/unittests/main.py b/unittests/unittests/main.py similarity index 100% rename from src/tests/unittests/main.py rename to unittests/unittests/main.py diff --git a/src/tests/unittests/unittests.json b/unittests/unittests/unittests.json similarity index 100% rename from src/tests/unittests/unittests.json rename to unittests/unittests/unittests.json diff --git a/src/tests/unittests_cli/__init__.py b/unittests/unittests_cli/__init__.py similarity index 100% rename from src/tests/unittests_cli/__init__.py rename to unittests/unittests_cli/__init__.py diff --git a/src/tests/unittests_cli/add_test_case.py b/unittests/unittests_cli/add_test_case.py similarity index 100% rename from src/tests/unittests_cli/add_test_case.py rename to unittests/unittests_cli/add_test_case.py diff --git a/src/tests/unittests_cli/build_test_case.py b/unittests/unittests_cli/build_test_case.py similarity index 100% rename from src/tests/unittests_cli/build_test_case.py rename to unittests/unittests_cli/build_test_case.py diff --git a/src/tests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py similarity index 92% rename from src/tests/unittests_cli/cli_test_suite.py rename to unittests/unittests_cli/cli_test_suite.py index 9532fe0c..06a30252 100644 --- a/src/tests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -46,9 +46,9 @@ class CLITestSuite(unittest.TestSuite): print(f'Setup {__name__}') try: if os.path.exists(PLAYGROUND_PATH): - shutil.rmtree(PLAYGROUND_PATH) + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) - os.mkdir(PLAYGROUND_PATH) + os.makedirs(PLAYGROUND_PATH) os.chdir(PLAYGROUND_PATH) except Exception as e: print(f'Setup of {__name__} failed: {traceback.format_exc()}') @@ -57,7 +57,7 @@ class CLITestSuite(unittest.TestSuite): print(f'Cleanup {__name__}') try: if os.path.exists(PLAYGROUND_PATH): - shutil.rmtree(PLAYGROUND_PATH) + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) except Exception as e: print(f'Cleanup of {__name__} failed: {traceback.format_exc()}') diff --git a/src/tests/unittests_cli/constants.py b/unittests/unittests_cli/constants.py similarity index 56% rename from src/tests/unittests_cli/constants.py rename to unittests/unittests_cli/constants.py index bcaa9d93..917dda78 100644 --- a/src/tests/unittests_cli/constants.py +++ b/unittests/unittests_cli/constants.py @@ -1,4 +1,4 @@ import os PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground')) -CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../cpl_cli/main.py')) +CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../src/cpl_cli/main.py')) diff --git a/src/tests/unittests_cli/custom_test_case.py b/unittests/unittests_cli/custom_test_case.py similarity index 100% rename from src/tests/unittests_cli/custom_test_case.py rename to unittests/unittests_cli/custom_test_case.py diff --git a/src/tests/unittests_cli/generate_test_case.py b/unittests/unittests_cli/generate_test_case.py similarity index 100% rename from src/tests/unittests_cli/generate_test_case.py rename to unittests/unittests_cli/generate_test_case.py diff --git a/src/tests/unittests_cli/install_test_case.py b/unittests/unittests_cli/install_test_case.py similarity index 100% rename from src/tests/unittests_cli/install_test_case.py rename to unittests/unittests_cli/install_test_case.py diff --git a/src/tests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py similarity index 100% rename from src/tests/unittests_cli/new_test_case.py rename to unittests/unittests_cli/new_test_case.py diff --git a/src/tests/unittests_cli/publish_test_case.py b/unittests/unittests_cli/publish_test_case.py similarity index 100% rename from src/tests/unittests_cli/publish_test_case.py rename to unittests/unittests_cli/publish_test_case.py diff --git a/src/tests/unittests_cli/remove_test_case.py b/unittests/unittests_cli/remove_test_case.py similarity index 100% rename from src/tests/unittests_cli/remove_test_case.py rename to unittests/unittests_cli/remove_test_case.py diff --git a/src/tests/unittests_cli/run_test_case.py b/unittests/unittests_cli/run_test_case.py similarity index 100% rename from src/tests/unittests_cli/run_test_case.py rename to unittests/unittests_cli/run_test_case.py diff --git a/src/tests/unittests_cli/start_test_case.py b/unittests/unittests_cli/start_test_case.py similarity index 100% rename from src/tests/unittests_cli/start_test_case.py rename to unittests/unittests_cli/start_test_case.py diff --git a/src/tests/unittests_cli/uninstall_test_case.py b/unittests/unittests_cli/uninstall_test_case.py similarity index 100% rename from src/tests/unittests_cli/uninstall_test_case.py rename to unittests/unittests_cli/uninstall_test_case.py diff --git a/src/tests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json similarity index 100% rename from src/tests/unittests_cli/unittests_cli.json rename to unittests/unittests_cli/unittests_cli.json diff --git a/src/tests/unittests_cli/update_test_case.py b/unittests/unittests_cli/update_test_case.py similarity index 100% rename from src/tests/unittests_cli/update_test_case.py rename to unittests/unittests_cli/update_test_case.py diff --git a/src/tests/unittests_cli/version_test_case.py b/unittests/unittests_cli/version_test_case.py similarity index 100% rename from src/tests/unittests_cli/version_test_case.py rename to unittests/unittests_cli/version_test_case.py diff --git a/src/tests/unittests_core/__init__.py b/unittests/unittests_core/__init__.py similarity index 100% rename from src/tests/unittests_core/__init__.py rename to unittests/unittests_core/__init__.py diff --git a/src/tests/unittests_core/unittests_core.json b/unittests/unittests_core/unittests_core.json similarity index 100% rename from src/tests/unittests_core/unittests_core.json rename to unittests/unittests_core/unittests_core.json diff --git a/src/tests/unittests_query/__init__.py b/unittests/unittests_query/__init__.py similarity index 100% rename from src/tests/unittests_query/__init__.py rename to unittests/unittests_query/__init__.py diff --git a/src/tests/unittests_query/unittests_query.json b/unittests/unittests_query/unittests_query.json similarity index 100% rename from src/tests/unittests_query/unittests_query.json rename to unittests/unittests_query/unittests_query.json diff --git a/src/tests/unittests_shared/__init__.py b/unittests/unittests_shared/__init__.py similarity index 100% rename from src/tests/unittests_shared/__init__.py rename to unittests/unittests_shared/__init__.py diff --git a/src/tests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py similarity index 100% rename from src/tests/unittests_shared/cli_commands.py rename to unittests/unittests_shared/cli_commands.py diff --git a/src/tests/unittests_shared/unittests_shared.json b/unittests/unittests_shared/unittests_shared.json similarity index 100% rename from src/tests/unittests_shared/unittests_shared.json rename to unittests/unittests_shared/unittests_shared.json