mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 06:24:20 +01:00
24 lines
787 B
Python
24 lines
787 B
Python
import pytest
|
|
from agbenchmark.tests.basic_abilities.BasicChallenge import BasicChallenge
|
|
import os
|
|
|
|
|
|
class TestWriteFile(BasicChallenge):
|
|
"""Testing if LLM can write to a file"""
|
|
|
|
def get_file_path(self) -> str: # all tests must implement this method
|
|
return os.path.join(os.path.dirname(__file__), "w_file_data.json")
|
|
|
|
@pytest.mark.depends(on=[], name="basic_write_file")
|
|
def test_method(self, workspace):
|
|
print("my workspace is ", workspace)
|
|
files_contents = self.open_files(workspace, self.data.ground.files)
|
|
|
|
scores = []
|
|
for file_content in files_contents:
|
|
score = self.scoring(file_content, self.data.ground)
|
|
print("Your score is:", score)
|
|
scores.append(score)
|
|
|
|
assert 1 in scores
|