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