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

Function test_render_templates_with_python

tests/test_briefcase.py:332–344  ·  view source on GitHub ↗

Test when a Python dist is present, has_python is True and the OPTION_REGISTER_PYTHON block should appear in the rendered output.

()

Source from the content-addressed store, hash-verified

330
331@pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
332def test_render_templates_with_python():
333 """Test when a Python dist is present, has_python is True and the
334 OPTION_REGISTER_PYTHON block should appear in the rendered output."""
335 info = mock_info.copy()
336 info["_dists"] = ["python-3.11.5-0.tar.bz2"]
337 payload = Payload(info)
338 rendered_templates = payload.render_templates()
339
340 run_installation = next(f for f in rendered_templates if f.name == "run_installation.bat")
341 text = run_installation.read_text(encoding="utf-8")
342 assert "OPTION_REGISTER_PYTHON" in text
343 assert "PythonCore" in text
344 assert "3.11" in text
345
346
347@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