fix: follow-up for salvaged PR #8939

- Move test file to tests/hermes_cli/ (consistent with test layout)
- Remove unused imports (os, pytest) from test file
- Update _sanitize_env_lines docstring: now used on read + write paths
This commit is contained in:
Teknium
2026-04-13 04:35:13 -07:00
committed by Teknium
parent e469f3f3db
commit cea34dc7ef
2 changed files with 1 additions and 4 deletions

View File

@@ -2413,7 +2413,7 @@ def load_env() -> Dict[str, str]:
def _sanitize_env_lines(lines: list) -> list:
"""Fix corrupted .env lines before writing.
"""Fix corrupted .env lines before reading or writing.
Handles two known corruption patterns:
1. Concatenated KEY=VALUE pairs on a single line (missing newline between

View File

@@ -1,12 +1,9 @@
"""Tests for .env sanitization during load to prevent token duplication (#8908)."""
import os
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
def test_load_env_sanitizes_concatenated_lines():
"""Verify load_env() splits concatenated KEY=VALUE pairs.