Private
Public Access
0
0
Files
manual_slop/scripts/tier2/rename_test_file.py
T
ed 3e2b4f74ba test(ai_client): rename send_result to send in test_conductor_engine_v2
22 references renamed (mostly monkeypatch.setattr calls + comments).
Test file state: GREEN. All 10 tests in this file now pass.
2026-06-17 00:29:21 -04:00

25 lines
705 B
Python

"""Rename send_result -> send in a single test file (idempotent: only renames occurrences of send_result)."""
from __future__ import annotations
import sys
from pathlib import Path
def main() -> int:
rel = sys.argv[1]
p = Path(rel)
with p.open("r", encoding="utf-8", newline="") as f:
content = f.read()
has_crlf = "\r\n" in content
new_content = content.replace("send_result", "send")
with p.open("w", encoding="utf-8", newline="") as f:
f.write(new_content)
remaining = new_content.count("send_result")
before = content.count("send_result")
print(f"{rel}: renamed {before - remaining} occurrences; remaining={remaining}")
return 0
if __name__ == "__main__":
raise SystemExit(main())