Fix file_operations tests

This commit is contained in:
Reinier van der Leer
2023-10-17 17:07:15 -07:00
parent 129483b21c
commit 7e7365eac2
2 changed files with 11 additions and 3 deletions

View File

@@ -33,5 +33,5 @@ class AgentFileManager:
def init_file_ops_log(file_logger_path: Path) -> Path:
if not file_logger_path.exists():
with file_logger_path.open(mode="w", encoding="utf-8") as f:
f.write("File Operation Logger ")
f.write("")
return file_logger_path

View File

@@ -264,8 +264,16 @@ def test_append_to_file_uses_checksum_from_appended_file(
test_file_name: Path, agent: Agent
):
append_text = "This is appended text.\n"
file_ops.append_to_file(test_file_name, append_text, agent=agent)
file_ops.append_to_file(test_file_name, append_text, agent=agent)
file_ops.append_to_file(
agent.workspace.get_path(test_file_name),
append_text,
agent=agent,
)
file_ops.append_to_file(
agent.workspace.get_path(test_file_name),
append_text,
agent=agent,
)
with open(agent.file_manager.file_ops_log_path, "r", encoding="utf-8") as f:
log_contents = f.read()