Added tests for generate command
This commit is contained in:
23
src/tests/unittests_shared/cli_commands.py
Normal file
23
src/tests/unittests_shared/cli_commands.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
class CLICommands:
|
||||
|
||||
@staticmethod
|
||||
def _run(cmd: str, *args):
|
||||
env_vars = os.environ
|
||||
command = ['python', os.path.abspath(os.path.join(os.getcwd(), '../../../cpl_cli/main.py')), cmd]
|
||||
for arg in args:
|
||||
command.append(arg)
|
||||
|
||||
print(f'Running {command}')
|
||||
subprocess.run(command, env=env_vars)
|
||||
|
||||
@classmethod
|
||||
def generate(cls, *args):
|
||||
cls._run('generate', *args)
|
||||
|
||||
@classmethod
|
||||
def new(cls, *args):
|
||||
cls._run('new', *args)
|
||||
Reference in New Issue
Block a user