Improved tests #129

This commit is contained in:
2022-12-01 23:23:48 +01:00
parent f0f79e7e3b
commit 2840628443
19 changed files with 103 additions and 153 deletions

View File

@@ -2,18 +2,17 @@ import filecmp
import json
import os
import shutil
import unittest
from cpl_core.utils import String
from unittests_cli.abc.command_test_case import CommandTestCase
from unittests_cli.constants import PLAYGROUND_PATH
from unittests_shared.cli_commands import CLICommands
class BuildTestCase(unittest.TestCase):
class BuildTestCase(CommandTestCase):
def __init__(self, methodName: str):
unittest.TestCase.__init__(self, methodName)
def __init__(self, method_name: str):
CommandTestCase.__init__(self, method_name)
self._source = 'build-test-source'
self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json'
@@ -39,13 +38,6 @@ class BuildTestCase(unittest.TestCase):
CLICommands.new('console', self._source, '--ab', '--s')
os.chdir(os.path.join(os.getcwd(), self._source))
def cleanUp(self):
# remove projects
if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))):
return
shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source)))
def _are_dir_trees_equal(self, dir1, dir2):
"""
found at https://stackoverflow.com/questions/4187564/recursively-compare-two-directories-to-ensure-they-have-the-same-files-and-subdi