mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 06:24:20 +01:00
35 lines
971 B
Python
35 lines
971 B
Python
import pytest
|
|
from agbenchmark.challenges.define_task_types import ChallengeData
|
|
from agbenchmark.tests.basic_abilities.BasicChallenge import BasicChallenge
|
|
import os
|
|
|
|
data = ChallengeData.deserialize(
|
|
os.path.join(os.path.dirname(__file__), "w_file_data.json")
|
|
)
|
|
|
|
|
|
class TestWriteFile(BasicChallenge):
|
|
"""Testing if LLM can write to a file"""
|
|
|
|
@pytest.mark.parametrize(
|
|
"server_response",
|
|
[(data.task, data.mock_func)],
|
|
indirect=True,
|
|
)
|
|
@pytest.mark.parametrize(
|
|
"regression_data",
|
|
[data],
|
|
indirect=True,
|
|
)
|
|
@pytest.mark.depends(name="test_write_file")
|
|
def test_write_file(self, workspace):
|
|
files_contents = self.open_files(workspace, data.ground.files)
|
|
|
|
scores = []
|
|
for file_content in files_contents:
|
|
score = self.scoring(file_content, data.ground)
|
|
print("Your score is:", score)
|
|
scores.append(score)
|
|
|
|
assert 1 in scores
|