88from . 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
1416def test_cli_has_maincli ():
@@ -21,29 +23,29 @@ def test_cli_has_maincli():
2123
2224
2325def 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