Moved unittests

This commit is contained in:
Sven Heidemann 2022-05-26 15:49:52 +02:00
parent 79b51cf8c5
commit df32978a31
30 changed files with 9 additions and 34 deletions

View File

@ -7,11 +7,11 @@
"cpl-query": "src/cpl_query/cpl-query.json", "cpl-query": "src/cpl_query/cpl-query.json",
"set-version": "tools/set_version/set-version.json", "set-version": "tools/set_version/set-version.json",
"set-pip-urls": "tools/set_pip_urls/set-pip-urls.json", "set-pip-urls": "tools/set_pip_urls/set-pip-urls.json",
"unittests": "src/tests/unittests/unittests.json", "unittests": "unittests/unittests/unittests.json",
"unittests_cli": "src/tests/unittests_cli/unittests_cli.json", "unittests_cli": "unittests/unittests_cli/unittests_cli.json",
"unittests_core": "src/tests/unittests_core/unittests_core.json", "unittests_core": "unittests/unittests_core/unittests_core.json",
"unittests_query": "src/tests/unittests_query/unittests_query.json", "unittests_query": "unittests/unittests_query/unittests_query.json",
"unittests_shared": "src/tests/unittests_shared/unittests_shared.json" "unittests_shared": "unittests/unittests_shared/unittests_shared.json"
}, },
"Scripts": { "Scripts": {
"hello-world": "echo 'Hello World'", "hello-world": "echo 'Hello World'",

View File

@ -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)

View File

@ -46,9 +46,9 @@ class CLITestSuite(unittest.TestSuite):
print(f'Setup {__name__}') print(f'Setup {__name__}')
try: try:
if os.path.exists(PLAYGROUND_PATH): 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) os.chdir(PLAYGROUND_PATH)
except Exception as e: except Exception as e:
print(f'Setup of {__name__} failed: {traceback.format_exc()}') print(f'Setup of {__name__} failed: {traceback.format_exc()}')
@ -57,7 +57,7 @@ class CLITestSuite(unittest.TestSuite):
print(f'Cleanup {__name__}') print(f'Cleanup {__name__}')
try: try:
if os.path.exists(PLAYGROUND_PATH): if os.path.exists(PLAYGROUND_PATH):
shutil.rmtree(PLAYGROUND_PATH) shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../')))
except Exception as e: except Exception as e:
print(f'Cleanup of {__name__} failed: {traceback.format_exc()}') print(f'Cleanup of {__name__} failed: {traceback.format_exc()}')

View File

@ -1,4 +1,4 @@
import os import os
PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground')) 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'))