@@ -49,11 +49,13 @@ def __exit__(self, *exc_info):
4949 pass
5050
5151 def check (self , cmd , tag , name , expect , windowed = 0 , script_code = None ):
52+ created = set ()
5253 AU .create_alias (
5354 cmd ,
5455 {"tag" : tag },
5556 {"name" : name , "windowed" : windowed },
5657 self ._expect_target ,
58+ created ,
5759 script_code = script_code ,
5860 )
5961 print (* cmd .global_dir .glob ("*" ), sep = "\n " )
@@ -64,7 +66,7 @@ def check(self, cmd, tag, name, expect, windowed=0, script_code=None):
6466 if script_code :
6567 assert (cmd .global_dir / f"{ name } .exe.__script__.py" ).is_file ()
6668 assert (cmd .global_dir / f"{ name } .exe.__script__.py" ).read_text () == script_code
67- assert name .casefold () in cmd . scratch [ "aliasutils.create_alias.alias_written" ]
69+ assert name .casefold () in created
6870
6971 def check_32 (self , cmd , tag , name ):
7072 self .check (cmd , tag , name , self ._expect ["-32" ])
@@ -122,11 +124,13 @@ def test_write_alias_launcher_missing(fake_config, assert_log, tmp_path):
122124 fake_config .launcher_exe = tmp_path / "non-existent.exe"
123125 fake_config .default_platform = '-32'
124126 fake_config .global_dir = tmp_path / "bin"
127+ created = set ()
125128 AU .create_alias (
126129 fake_config ,
127130 {"tag" : "test" },
128131 {"name" : "test.exe" },
129132 tmp_path / "target.exe" ,
133+ created ,
130134 )
131135 assert_log (
132136 "Checking for launcher.*" ,
@@ -136,6 +140,7 @@ def test_write_alias_launcher_missing(fake_config, assert_log, tmp_path):
136140 "Skipping %s alias because the launcher template was not found." ,
137141 assert_log .end_of_log (),
138142 )
143+ assert "test" .casefold () in created
139144
140145
141146def test_write_alias_launcher_unreadable (fake_config , assert_log , tmp_path ):
@@ -156,11 +161,13 @@ def read_bytes():
156161 fake_config .launcher_exe = FakeLauncherPath
157162 fake_config .default_platform = '-32'
158163 fake_config .global_dir = tmp_path / "bin"
164+ created = set ()
159165 AU .create_alias (
160166 fake_config ,
161167 {"tag" : "test" },
162168 {"name" : "test.exe" },
163169 tmp_path / "target.exe" ,
170+ created ,
164171 )
165172 assert_log (
166173 "Checking for launcher.*" ,
@@ -169,6 +176,7 @@ def read_bytes():
169176 "Failed to read %s" ,
170177 assert_log .end_of_log (),
171178 )
179+ assert "test" .casefold () in created
172180
173181
174182def test_write_alias_launcher_unlinkable (fake_config , assert_log , tmp_path ):
@@ -180,11 +188,13 @@ def fake_link(x, y):
180188 fake_config .launcher_exe .write_bytes (b'Arbitrary contents' )
181189 fake_config .default_platform = '-32'
182190 fake_config .global_dir = tmp_path / "bin"
191+ created = set ()
183192 AU .create_alias (
184193 fake_config ,
185194 {"tag" : "test" },
186195 {"name" : "test.exe" },
187196 tmp_path / "target.exe" ,
197+ created ,
188198 _link = fake_link
189199 )
190200 assert_log (
@@ -194,6 +204,7 @@ def fake_link(x, y):
194204 "Created %s as copy of %s" ,
195205 assert_log .end_of_log (),
196206 )
207+ assert "test" .casefold () in created
197208
198209
199210def test_write_alias_launcher_unlinkable_remap (fake_config , assert_log , tmp_path ):
@@ -216,11 +227,13 @@ def fake_link(x, y):
216227 (tmp_path / "actual_launcher.txt" ).write_bytes (b'Arbitrary contents' )
217228 fake_config .default_platform = '-32'
218229 fake_config .global_dir = tmp_path / "bin"
230+ created = set ()
219231 AU .create_alias (
220232 fake_config ,
221233 {"tag" : "test" },
222234 {"name" : "test.exe" },
223235 tmp_path / "target.exe" ,
236+ created ,
224237 _link = fake_link
225238 )
226239 assert_log (
@@ -230,6 +243,7 @@ def fake_link(x, y):
230243 ("Created %s as hard link to %s" , ("test.exe" , "actual_launcher.txt" )),
231244 assert_log .end_of_log (),
232245 )
246+ assert "test" .casefold () in created
233247
234248
235249def test_parse_entrypoint_line ():
@@ -266,6 +280,7 @@ def test_scan_create_entrypoints(fake_config, tmp_path):
266280 fake_config ,
267281 install ,
268282 dict (dirs = ["site-packages" ]),
283+ set (),
269284 _create_alias = lambda * a , ** kw : created .append ((a , kw )),
270285 )
271286 assert 2 == len (created )
@@ -312,6 +327,7 @@ def fake_scan(*a):
312327 fake_config ,
313328 dict (prefix = fake_config .root , id = "test" , alias = alias ),
314329 {},
330+ set (),
315331 _create_alias = lambda * a , ** kw : created .append ((a , kw )),
316332 _scan = fake_scan ,
317333 )
0 commit comments