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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user