mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 22:44:21 +01:00
file creation from within file before server :)
This commit is contained in:
@@ -17,7 +17,7 @@ def config():
|
|||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture(scope="module")
|
||||||
def workspace(config):
|
def workspace(config):
|
||||||
yield config["workspace"]
|
yield config["workspace"]
|
||||||
# teardown after test function completes
|
# teardown after test function completes
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ def basic_read_file_mock(task: str, workspace: str):
|
|||||||
This mock reads a file and returns its content.
|
This mock reads a file and returns its content.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Challenge.write_to_file(workspace, "file_to_check.txt", "this is how we're doing")
|
# Challenge.write_to_file(workspace, "file_to_check.txt", "this is how we're doing")
|
||||||
|
|
||||||
file_contents = Challenge.open_file(workspace, "file_to_check.txt")
|
file_contents = Challenge.open_file(workspace, "file_to_check.txt")
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ data = ChallengeData.deserialize(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module", autouse=True)
|
||||||
|
def setup_module(workspace):
|
||||||
|
if data.ground.should_contain:
|
||||||
|
Challenge.write_to_file(
|
||||||
|
workspace, data.ground.files[0], "this is how we're doing"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestReadFile(Challenge):
|
class TestReadFile(Challenge):
|
||||||
"""Testing if LLM can read a file"""
|
"""Testing if LLM can read a file"""
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
agbenchmark/tests/basic_abilities/write_file/write_file_test.py::TestWriteFile::test_retrieval[server_response0]
|
||||||
|
agbenchmark/tests/basic_abilities/read_file/read_file_test.py::TestReadFile::test_retrieval[server_response0]
|
||||||
|
|||||||
Reference in New Issue
Block a user