[fix] tests for running by implementing the dry-run option to the domain command
This commit is contained in:
parent
c2eb95533c
commit
064127dc16
@ -119,6 +119,7 @@ def list_api_routes():
|
|||||||
# list_routes(domain, m_dom)
|
# list_routes(domain, m_dom)
|
||||||
|
|
||||||
|
|
||||||
|
@click.option('--dry-run',default=False, is_flag=True)
|
||||||
@click.option('--run',default=False, is_flag=True)
|
@click.option('--run',default=False, is_flag=True)
|
||||||
@click.option('--read',default=False, is_flag=True)
|
@click.option('--read',default=False, is_flag=True)
|
||||||
@click.option('--create',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('config_file', type=click.File(mode='rb'), required=False)
|
||||||
@click.argument('domain',default=None, required=False)
|
@click.argument('domain',default=None, required=False)
|
||||||
@cli.command()
|
@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
|
The "halfapi domain" command
|
||||||
|
|
||||||
@ -177,6 +178,9 @@ def domain(domain, config_file, delete, update, create, read, run): #, domains,
|
|||||||
'name': domain
|
'name': domain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if dry_run:
|
||||||
|
CONFIG['dryrun'] = True
|
||||||
|
|
||||||
CONFIG['domain'][domain]['enabled'] = True
|
CONFIG['domain'][domain]['enabled'] = True
|
||||||
port = CONFIG['domain'][domain].get('port', 3000)
|
port = CONFIG['domain'][domain].get('port', 3000)
|
||||||
|
|
||||||
|
@ -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)
|
print(r.stdout)
|
||||||
assert r.exit_code == 0
|
assert r.exit_code == 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user