55
66from qbpm .main import main
77
8+ no_desktop = "--no-desktop-file"
9+
810
911def test_profile_dir_option (tmp_path : Path ):
1012 (tmp_path / "config.py" ).touch ()
1113 runner = CliRunner ()
1214 result = runner .invoke (
13- main , ["-C" , str (tmp_path ), "-P" , str (tmp_path ), "new" , "test" ]
15+ main , ["-C" , str (tmp_path ), "-P" , str (tmp_path ), "new" , no_desktop , "test" ]
1416 )
1517 assert result .exit_code == 0
1618 assert result .output .strip () == str (tmp_path / "test" )
@@ -21,7 +23,7 @@ def test_profile_dir_env(tmp_path: Path):
2123 environ ["QBPM_PROFILE_DIR" ] = str (tmp_path )
2224 (tmp_path / "config.py" ).touch ()
2325 runner = CliRunner ()
24- result = runner .invoke (main , ["-C" , str (tmp_path ), "new" , "test" ])
26+ result = runner .invoke (main , ["-C" , str (tmp_path ), "new" , no_desktop , "test" ])
2527 assert result .exit_code == 0
2628 assert result .output .strip () == str (tmp_path / "test" )
2729 assert tmp_path / "test" in list (tmp_path .iterdir ())
@@ -32,7 +34,7 @@ def test_config_dir_option(tmp_path: Path):
3234 config = tmp_path / "config.py"
3335 config .touch ()
3436 runner = CliRunner ()
35- result = runner .invoke (main , ["-C" , str (tmp_path ), "new" , "test" ])
37+ result = runner .invoke (main , ["-C" , str (tmp_path ), "new" , no_desktop , "test" ])
3638 assert result .exit_code == 0
3739 assert str (config ) in (tmp_path / "test/config/config.py" ).read_text ()
3840
@@ -43,7 +45,7 @@ def test_relative_config_dir(tmp_path: Path):
4345 config .touch ()
4446 chdir (tmp_path )
4547 runner = CliRunner ()
46- result = runner .invoke (main , ["-C" , "." , "new" , "test" ])
48+ result = runner .invoke (main , ["-C" , "." , "new" , no_desktop , "test" ])
4749 assert result .exit_code == 0
4850 assert str (config ) in (tmp_path / "test/config/config.py" ).read_text ()
4951
@@ -54,7 +56,9 @@ def test_from_session(tmp_path: Path):
5456 session = tmp_path / "test.yml"
5557 session .write_text ("windows:\n " )
5658 runner = CliRunner ()
57- result = runner .invoke (main , ["-C" , str (tmp_path ), "from-session" , str (session )])
59+ result = runner .invoke (
60+ main , ["-C" , str (tmp_path ), "from-session" , no_desktop , str (session )]
61+ )
5862 assert result .exit_code == 0
5963 assert result .output .strip () == str (tmp_path / "test" )
6064 assert (tmp_path / "test/data/sessions/_autosave.yml" ).read_text () == ("windows:\n " )
0 commit comments