26 lines
525 B
Python
26 lines
525 B
Python
import os
|
|
import subprocess
|
|
|
|
from unittests_cli.constants import CLI_PATH
|
|
|
|
|
|
class CLICommands:
|
|
|
|
@staticmethod
|
|
def _run(cmd: str, *args):
|
|
env_vars = os.environ
|
|
env_vars['CPL_IS_UNITTEST'] = 'YES'
|
|
command = ['python', CLI_PATH, cmd]
|
|
for arg in args:
|
|
command.append(arg)
|
|
|
|
subprocess.run(command, env=env_vars)
|
|
|
|
@classmethod
|
|
def generate(cls, *args):
|
|
cls._run('generate', *args)
|
|
|
|
@classmethod
|
|
def new(cls, *args):
|
|
cls._run('new', *args)
|