Test when no Python dist is present, has_python is False and the OPTION_REGISTER_PYTHON block should not appear in the rendered output.
()
| 315 | |
| 316 | @pytest.mark.skipif(sys.platform != "win32", reason="Windows only") |
| 317 | def 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") |
nothing calls this directly
no test coverage detected