@@ -135,13 +135,28 @@ def check_output_from_shortcut(
135
135
if expected_output is not None :
136
136
assert output .strip () == expected_output
137
137
138
- return abs_json_path , paths , output
138
+ return abs_json_path , paths , tmp_base_path , output
139
139
140
140
141
141
def test_install_prefix (delete_files ):
142
142
check_output_from_shortcut (delete_files , "sys-prefix.json" , expected_output = sys .prefix )
143
143
144
144
145
+ @pytest .mark .skipif (PLATFORM != "win" , reason = "Windows only" )
146
+ def test_placeholders_in_menu_name (delete_files ):
147
+ _ , paths , tmp_base_path , _ = check_output_from_shortcut (
148
+ delete_files ,
149
+ "sys-prefix.json" ,
150
+ expected_output = sys .prefix ,
151
+ )
152
+ for path in paths :
153
+ if path .suffix == ".lnk" and "Start Menu" in path .parts :
154
+ assert path .parent .name == f"Sys.Prefix { Path (tmp_base_path ).name } "
155
+ break
156
+ else :
157
+ raise AssertionError ("Didn't find Start Menu" )
158
+
159
+
145
160
def test_precommands (delete_files ):
146
161
check_output_from_shortcut (
147
162
delete_files , "precommands.json" , expected_output = "rhododendron and bees"
@@ -150,7 +165,7 @@ def test_precommands(delete_files):
150
165
151
166
@pytest .mark .skipif (PLATFORM != "osx" , reason = "macOS only" )
152
167
def test_entitlements (delete_files ):
153
- json_path , paths , _ = check_output_from_shortcut (
168
+ json_path , paths , * _ = check_output_from_shortcut (
154
169
delete_files , "entitlements.json" , remove_after = False , expected_output = "entitlements"
155
170
)
156
171
# verify signature
@@ -182,7 +197,7 @@ def test_entitlements(delete_files):
182
197
183
198
@pytest .mark .skipif (PLATFORM != "osx" , reason = "macOS only" )
184
199
def test_no_entitlements_no_signature (delete_files ):
185
- json_path , paths , _ = check_output_from_shortcut (
200
+ json_path , paths , * _ = check_output_from_shortcut (
186
201
delete_files , "sys-prefix.json" , remove_after = False , expected_output = sys .prefix
187
202
)
188
203
app_dir = next (p for p in paths if p .name .endswith (".app" ))
@@ -198,7 +213,7 @@ def test_no_entitlements_no_signature(delete_files):
198
213
199
214
@pytest .mark .skipif (PLATFORM != "osx" , reason = "macOS only" )
200
215
def test_info_plist (delete_files ):
201
- json_path , paths , _ = check_output_from_shortcut (
216
+ json_path , paths , * _ = check_output_from_shortcut (
202
217
delete_files , "entitlements.json" , remove_after = False , expected_output = "entitlements"
203
218
)
204
219
app_dir = next (p for p in paths if p .name .endswith (".app" ))
@@ -217,7 +232,7 @@ def test_info_plist(delete_files):
217
232
218
233
@pytest .mark .skipif (PLATFORM != "osx" , reason = "macOS only" )
219
234
def test_osx_symlinks (delete_files ):
220
- json_path , paths , output = check_output_from_shortcut (
235
+ json_path , paths , _ , output = check_output_from_shortcut (
221
236
delete_files , "osx_symlinks.json" , remove_after = False
222
237
)
223
238
app_dir = next (p for p in paths if p .name .endswith (".app" ))
0 commit comments