2022.12 #133
@ -18,6 +18,6 @@ class Application(ApplicationABC):
|
||||
|
||||
def main(self):
|
||||
runner = unittest.TextTestRunner()
|
||||
# runner.run(CLITestSuite())
|
||||
runner.run(CLITestSuite())
|
||||
runner.run(QueryTestSuite())
|
||||
# runner.run(TranslationTestSuite())
|
||||
runner.run(TranslationTestSuite())
|
||||
|
@ -26,7 +26,10 @@ class AddTestCase(unittest.TestCase):
|
||||
return project_json
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -31,7 +31,10 @@ class BuildTestCase(unittest.TestCase):
|
||||
project_file.close()
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -75,4 +75,4 @@ class CLITestSuite(unittest.TestSuite):
|
||||
def run(self, *args):
|
||||
self._setup()
|
||||
self._result = super().run(*args)
|
||||
# self._cleanup()
|
||||
self._cleanup()
|
||||
|
@ -1,5 +1,9 @@
|
||||
import os
|
||||
|
||||
PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../test_cli_playground'))
|
||||
TRANSLATION_PATH = os.path.abspath(os.path.join(os.getcwd(), '../unittests_translation'))
|
||||
CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../src/cpl_cli/main.py'))
|
||||
base = ''
|
||||
if not os.getcwd().endswith('unittests'):
|
||||
base = '../'
|
||||
|
||||
PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), f'{base}test_cli_playground'))
|
||||
TRANSLATION_PATH = os.path.abspath(os.path.join(os.getcwd(), f'{base}unittests_translation'))
|
||||
CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), f'{base}../src/cpl_cli/main.py'))
|
||||
|
@ -31,7 +31,10 @@ class InstallTestCase(unittest.TestCase):
|
||||
project_file.close()
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -10,7 +10,10 @@ from unittests_shared.cli_commands import CLICommands
|
||||
class NewTestCase(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
|
||||
def _test_project(self, project_type: str, name: str, *args, test_venv=False, without_ws=False):
|
||||
CLICommands.new(project_type, name, *args)
|
||||
|
@ -31,7 +31,10 @@ class PublishTestCase(unittest.TestCase):
|
||||
project_file.close()
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -24,7 +24,10 @@ class RemoveTestCase(unittest.TestCase):
|
||||
return project_json
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -50,7 +50,10 @@ class RunTestCase(unittest.TestCase):
|
||||
project_file.close()
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -50,7 +50,10 @@ class StartTestCase(unittest.TestCase):
|
||||
project_file.close()
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -29,7 +29,10 @@ class UninstallTestCase(unittest.TestCase):
|
||||
return project_json
|
||||
|
||||
def setUp(self):
|
||||
os.chdir(os.path.abspath(PLAYGROUND_PATH))
|
||||
if not os.path.exists(PLAYGROUND_PATH):
|
||||
os.makedirs(PLAYGROUND_PATH)
|
||||
|
||||
os.chdir(PLAYGROUND_PATH)
|
||||
# create projects
|
||||
CLICommands.new('console', self._source, '--ab', '--s')
|
||||
os.chdir(os.path.join(os.getcwd(), self._source))
|
||||
|
@ -25,4 +25,4 @@ class QueryTestSuite(unittest.TestSuite):
|
||||
|
||||
if __name__ == "__main__":
|
||||
runner = unittest.TextTestRunner()
|
||||
runner.run(QueryTestSuite())
|
||||
runner.run(QueryTestSuite())
|
||||
|
Loading…
Reference in New Issue
Block a user