MCPcopy Create free account
hub / github.com/conda/constructor / test_render_templates_no_python

Function test_render_templates_no_python

tests/test_briefcase.py:317–328  ·  view source on GitHub ↗

Test when no Python dist is present, has_python is False and the OPTION_REGISTER_PYTHON block should not appear in the rendered output.

()

Source from the content-addressed store, hash-verified

315
316@pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
317def test_render_templates_no_python():
318 """Test when no Python dist is present, has_python is False and the
319 OPTION_REGISTER_PYTHON block should not appear in the rendered output."""
320 info = mock_info.copy()
321 info["_dists"] = []
322 payload = Payload(info)
323 rendered_templates = payload.render_templates()
324
325 run_installation = next(f for f in rendered_templates if f.name == "run_installation.bat")
326 text = run_installation.read_text(encoding="utf-8")
327 assert "OPTION_REGISTER_PYTHON" not in text
328 assert "PythonCore" not in text
329
330
331@pytest.mark.skipif(sys.platform != "win32", reason="Windows only")

Callers

nothing calls this directly

Calls 3

render_templatesMethod · 0.95
PayloadClass · 0.90
read_textMethod · 0.45

Tested by

no test coverage detected