mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-19 07:48:29 +08:00
Per @guill review on PR #13425: add tests covering Windows-style line endings, since editors often save files with CRLF and we want to confirm the CR never leaks into the returned value. - `_write_env_file` now opens with `newline=""` so the on-disk bytes match the literal string passed in (deterministic across host OSes, no `\n` -> `\r\n` translation on Windows). New tests: - `test_crlf_line_ending`: `"...\r\n"` -> value (no trailing CR). - `test_crlf_multiline_only_first_line_used`: `readline(128)` stops at the translated newline boundary for CRLF lines. - `test_crlf_with_surrounding_whitespace`: leading/trailing spaces + CRLF still yield the bare value. - `test_lone_cr_line_ending`: classic-Mac / legacy editor `"...\r"` is also handled by universal-newlines decoding. 15/15 unit tests pass. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019df5a8-36be-7107-a4af-c7e4f51687df
Pytest Unit Tests
Install test dependencies
pip install -r tests-unit/requirements.txt
Run tests
pytest tests-unit/