Added tests for generate command

This commit is contained in:
2022-05-26 14:47:36 +02:00
parent 46cceb0910
commit d937c4c0e6
10 changed files with 89 additions and 25 deletions

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