Skip to content

Commit 89f0758

Browse files
committed
Add test for when entrypoints are disabled
1 parent a3d5f8c commit 89f0758

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/test_alias.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,36 @@ def test_scan_entrypoints(fake_config, tmp_path):
269269
assert [None, None, None, "main", "main"] == [a.func for a in actual]
270270

271271

272+
def test_scan_entrypoints_disabled(fake_config, tmp_path):
273+
fake_config.enable_entrypoints = False
274+
root = tmp_path / "test_install"
275+
site = root / "site-packages"
276+
A = site / "A.dist-info"
277+
A.mkdir(parents=True, exist_ok=True)
278+
(root / "target.exe").write_bytes(b"")
279+
(A / "entry_points.txt").write_text("""[console_scripts]
280+
a = a:main
281+
282+
[gui_scripts]
283+
aw = a:main
284+
""")
285+
286+
install = dict(
287+
prefix=root,
288+
id="test",
289+
default=1,
290+
alias=[dict(name="target", target="target.exe")],
291+
shortcuts=[dict(kind="site-dirs", dirs=["site-packages"])],
292+
)
293+
294+
actual = list(AU.calculate_aliases(fake_config, install))
295+
296+
assert ["target", "python", "pythonw"] == [a.name for a in actual]
297+
assert [0, 0, 1] == [a.windowed for a in actual]
298+
assert [None, None, None] == [a.mod for a in actual]
299+
assert [None, None, None] == [a.func for a in actual]
300+
301+
272302
def test_create_aliases(fake_config, tmp_path):
273303
target = tmp_path / "target.exe"
274304
target.write_bytes(b"")

0 commit comments

Comments
 (0)