Skip to content

Commit f9dcc9b

Browse files
authored
Merge pull request #1043 from haddocking/update-main-cli-description
Update main cli description
2 parents 13d11cc + 1a9df1e commit f9dcc9b

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

src/haddock/clis/cli.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@
3636
ap = argparse.ArgumentParser()
3737

3838
ap.add_argument(
39-
"recipe",
39+
"workflow",
4040
type=arg_file_exist,
41-
help="The input recipe file path",
42-
)
41+
help=(
42+
"The input configuration file path describing "
43+
"the workflow to be performed"
44+
),
45+
)
4346

4447
add_restart_arg(ap)
4548
add_extend_run(ap)
@@ -76,7 +79,7 @@ def maincli() -> None:
7679

7780

7881
def main(
79-
recipe: FilePath,
82+
workflow: FilePath,
8083
restart: Optional[int] = None,
8184
extend_run: Optional[FilePath] = EXTEND_RUN_DEFAULT,
8285
setup_only: bool = False,
@@ -87,8 +90,8 @@ def main(
8790
8891
Parameters
8992
----------
90-
recipe : str or pathlib.Path
91-
The path to the recipe (config file).
93+
workflow : str or pathlib.Path
94+
The path to the workflow (config file).
9295
9396
restart : int
9497
The step to restart the run from (inclusive).
@@ -145,7 +148,7 @@ def main(
145148

146149
with log_error_and_exit():
147150
params, other_params = setup_run(
148-
recipe,
151+
workflow,
149152
restart_from=restart,
150153
extend_run=extend_run,
151154
)

tests/test_cli.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
from . import configs_data
99

1010

11-
recipe = Path(configs_data, 'recipe.cfg')
11+
@pytest.fixture(name="workflow")
12+
def fixture_workflow():
13+
yield Path(configs_data, "recipe.cfg")
1214

1315

1416
def test_cli_has_maincli():
@@ -21,29 +23,29 @@ def test_cli_has_maincli():
2123

2224

2325
def test_ap_recipe_does_not_exist():
24-
"""Test raise error if recipe does not exist."""
26+
"""Test raise error if workflow does not exist."""
2527
with pytest.raises(SystemExit) as exit:
2628
cli.ap.parse_args('does_not_exit.cfg'.split())
2729
assert exit.type == SystemExit
2830
assert exit.value.code == 2
2931

3032

31-
def test_ap_recipe_exists():
32-
"""Test reading recipes."""
33-
cmd = cli.ap.parse_args(str(recipe).split())
34-
with open(cmd.recipe) as fin:
33+
def test_ap_workflow_exists(workflow):
34+
"""Test reading workflows."""
35+
cmd = cli.ap.parse_args(str(workflow).split())
36+
with open(cmd.workflow) as fin:
3537
fin.readlines()
3638

3739

38-
def test_ap_setup_true():
40+
def test_ap_setup_true(workflow):
3941
"""Test --setup flag."""
40-
cmd = cli.ap.parse_args(f'{recipe} --setup'.split())
42+
cmd = cli.ap.parse_args(f'{workflow} --setup'.split())
4143
assert cmd.setup_only is True
4244

4345

44-
def test_ap_setup_false():
46+
def test_ap_setup_false(workflow):
4547
"""Test setup only default."""
46-
cmd = cli.ap.parse_args(str(recipe).split())
48+
cmd = cli.ap.parse_args(str(workflow).split())
4749
assert cmd.setup_only is False
4850

4951

@@ -59,15 +61,15 @@ def test_ap_version():
5961
'level',
6062
("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"),
6163
)
62-
def test_ap_log_level(level):
64+
def test_ap_log_level(workflow, level):
6365
"""Test --log-level correct."""
64-
cmd = cli.ap.parse_args(f'{recipe} --log-level {level}'.split())
66+
cmd = cli.ap.parse_args(f'{workflow} --log-level {level}'.split())
6567
assert cmd.log_level == level
6668

6769

68-
def test_ap_log_level_error():
70+
def test_ap_log_level_error(workflow):
6971
"""Test --log-level error with bad input."""
7072
with pytest.raises(SystemExit) as exit:
71-
cli.ap.parse_args(f'{recipe} --log-level BAD'.split())
73+
cli.ap.parse_args(f'{workflow} --log-level BAD'.split())
7274
assert exit.type == SystemExit
7375
assert exit.value.code == 2

0 commit comments

Comments
 (0)