Test that debug logging affects template generation.
(debug_logging)
| 298 | @pytest.mark.skipif(sys.platform != "win32", reason="Windows only") |
| 299 | @pytest.mark.parametrize("debug_logging", [True, False]) |
| 300 | def test_templates_debug_mode(debug_logging): |
| 301 | """Test that debug logging affects template generation.""" |
| 302 | info = mock_info.copy() |
| 303 | payload = Payload(info) |
| 304 | payload.add_debug_logging = debug_logging |
| 305 | rendered_templates = payload.render_templates() |
| 306 | assert len(rendered_templates) == 2 |
| 307 | |
| 308 | for f in rendered_templates: |
| 309 | assert f.is_file() |
| 310 | with open(f) as open_file: |
| 311 | lines = open_file.readlines() |
| 312 | expected = "@echo on\n" if debug_logging else "@echo off\n" |
| 313 | assert lines[0] == expected |
| 314 | |
| 315 | |
| 316 | @pytest.mark.skipif(sys.platform != "win32", reason="Windows only") |
nothing calls this directly
no test coverage detected