mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-02-09 00:04:31 +01:00
Fix file_operations tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user