drift-quant / tests /test_logging.py
deveshc23
Initialize architecture and engineering foundation
c962775
Raw History Blame Contribute Delete
447 Bytes
from __future__ import annotations
from drift_quant.logging import REDACTED_VALUE, redact
def test_redact_removes_nested_secret_values() -> None:
payload = {
"api_key": "visible-never",
"nested": {"Authorization": "Bearer visible-never"},
"normal": "safe",
}
assert redact(payload) == {
"api_key": REDACTED_VALUE,
"nested": {"Authorization": REDACTED_VALUE},
"normal": "safe",
}