Skip to content

Commit a36f76a

Browse files
committed
Update args
1 parent 2eec6d2 commit a36f76a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/manage/aliasutils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ def create_aliases(cmd, aliases, *, _create_alias=_create_alias):
320320
try:
321321
_create_alias(
322322
cmd,
323-
install=alias.install,
324323
name=alias.name,
325324
plat=alias.install.get("tag", "").rpartition("-")[2],
326325
target=target,

tests/test_alias.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,9 @@ def test_create_aliases(fake_config, tmp_path):
276276
target.write_bytes(b"")
277277

278278
created = []
279-
def _on_create(cmd, **kwargs):
280-
created.append(kwargs)
279+
# Full arguments copied from source to ensure callers only pass valid args
280+
def _on_create(cmd, *, name, target, plat=None, windowed=0, script_code=None):
281+
created.append((name, windowed, script_code))
281282

282283
aliases = [
283284
AU.AliasInfo(install=dict(prefix=tmp_path), name="a", target=target),
@@ -288,9 +289,9 @@ def _on_create(cmd, **kwargs):
288289
AU.create_aliases(fake_config, aliases, _create_alias=_on_create)
289290
print(created)
290291

291-
assert ["a", "aw"] == [a["name"] for a in created]
292-
assert [0, 1] == [a["windowed"] for a in created]
293-
assert [None, None] == [a["script_code"] for a in created]
292+
assert ["a", "aw"] == [a[0] for a in created]
293+
assert [0, 1] == [a[1] for a in created]
294+
assert [None, None] == [a[2] for a in created]
294295

295296

296297
def test_cleanup_aliases(fake_config, tmp_path):

0 commit comments

Comments
 (0)