def module_teardown_setup_project_setup(): try: expipe.delete_project(PROJECT_ID, remove_all_childs=True) except NameError: pass project = expipe.require_project(PROJECT_ID) from expipe_plugin_cinpla.main import CinplaPlugin CinplaPlugin().attach_to_cli(cli) # make surgery action run_command(['register-surgery', pytest.RAT_ID, '--weight', '500', '--birthday', '21.05.2017', '--procedure', 'implantation', '-d', '21.01.2017T14:40', '-a', 'mecl', 1.9, '-a', 'mecr', 1.8]) # init adjusment run_command(['adjust', pytest.RAT_ID, '-a', 'mecl', 50, '-a', 'mecr', 50, '-d', 'now', '--init'], inp='y') yield project
from click.testing import CliRunner import quantities as pq import os.path as op from expipe_plugin_cinpla.axona import AxonaPlugin from expipe_plugin_cinpla.main import CinplaPlugin expipe.ensure_testing() @click.group() @click.pass_context def cli(ctx): pass AxonaPlugin().attach_to_cli(cli) CinplaPlugin().attach_to_cli(cli) def run_command(command_list, inp=None): result = CliRunner().invoke(cli, command_list, input=inp) if result.exit_code != 0: print(result.output) raise result.exception return result def test_axona(module_teardown_setup_project_setup): project = module_teardown_setup_project_setup # action_id = pytest.RAT_ID + '-311013-03' data_path = op.join(expipe.settings['data_path'],