5
5
6
6
from qbpm .main import main
7
7
8
+ no_desktop = "--no-desktop-file"
9
+
8
10
9
11
def test_profile_dir_option (tmp_path : Path ):
10
12
(tmp_path / "config.py" ).touch ()
11
13
runner = CliRunner ()
12
14
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" ]
14
16
)
15
17
assert result .exit_code == 0
16
18
assert result .output .strip () == str (tmp_path / "test" )
@@ -21,7 +23,7 @@ def test_profile_dir_env(tmp_path: Path):
21
23
environ ["QBPM_PROFILE_DIR" ] = str (tmp_path )
22
24
(tmp_path / "config.py" ).touch ()
23
25
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" ])
25
27
assert result .exit_code == 0
26
28
assert result .output .strip () == str (tmp_path / "test" )
27
29
assert tmp_path / "test" in list (tmp_path .iterdir ())
@@ -32,7 +34,7 @@ def test_config_dir_option(tmp_path: Path):
32
34
config = tmp_path / "config.py"
33
35
config .touch ()
34
36
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" ])
36
38
assert result .exit_code == 0
37
39
assert str (config ) in (tmp_path / "test/config/config.py" ).read_text ()
38
40
@@ -43,7 +45,7 @@ def test_relative_config_dir(tmp_path: Path):
43
45
config .touch ()
44
46
chdir (tmp_path )
45
47
runner = CliRunner ()
46
- result = runner .invoke (main , ["-C" , "." , "new" , "test" ])
48
+ result = runner .invoke (main , ["-C" , "." , "new" , no_desktop , "test" ])
47
49
assert result .exit_code == 0
48
50
assert str (config ) in (tmp_path / "test/config/config.py" ).read_text ()
49
51
@@ -54,7 +56,9 @@ def test_from_session(tmp_path: Path):
54
56
session = tmp_path / "test.yml"
55
57
session .write_text ("windows:\n " )
56
58
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
+ )
58
62
assert result .exit_code == 0
59
63
assert result .output .strip () == str (tmp_path / "test" )
60
64
assert (tmp_path / "test/data/sessions/_autosave.yml" ).read_text () == ("windows:\n " )
0 commit comments