3e2b4f74ba
22 references renamed (mostly monkeypatch.setattr calls + comments). Test file state: GREEN. All 10 tests in this file now pass.
25 lines
705 B
Python
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())
|