[fix] tests for running by implementing the dry-run option to the domain command

This commit is contained in:
Maxime Alves LIRMM@home 2023-02-03 00:02:56 +01:00
parent c2eb95533c
commit 064127dc16
2 changed files with 6 additions and 2 deletions

View File

@ -119,6 +119,7 @@ def list_api_routes():
# list_routes(domain, m_dom)
@click.option('--dry-run',default=False, is_flag=True)
@click.option('--run',default=False, is_flag=True)
@click.option('--read',default=False, is_flag=True)
@click.option('--create',default=False, is_flag=True)
@ -127,7 +128,7 @@ def list_api_routes():
@click.argument('config_file', type=click.File(mode='rb'), required=False)
@click.argument('domain',default=None, required=False)
@cli.command()
def domain(domain, config_file, delete, update, create, read, run): #, domains, read, create, update, delete):
def domain(domain, config_file, delete, update, create, read, run, dry_run): #, domains, read, create, update, delete):
"""
The "halfapi domain" command
@ -177,6 +178,9 @@ def domain(domain, config_file, delete, update, create, read, run): #, domains,
'name': domain
}
if dry_run:
CONFIG['dryrun'] = True
CONFIG['domain'][domain]['enabled'] = True
port = CONFIG['domain'][domain].get('port', 3000)

View File

@ -39,7 +39,7 @@ class TestCliProj():
})
)
r = project_runner(f'domain dummy_domain {tmp_conf}')
r = project_runner(f'domain dummy_domain --dry-run {tmp_conf}')
print(r.stdout)
assert r.exit_code == 0