file creation from within file before server :)

This commit is contained in:
Silen Naihin
2023-06-24 12:15:53 -04:00
parent 8c44b9eddf
commit 22458a04e8
4 changed files with 12 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ def config():
return config
@pytest.fixture
@pytest.fixture(scope="module")
def workspace(config):
yield config["workspace"]
# teardown after test function completes

View File

@@ -7,7 +7,7 @@ def basic_read_file_mock(task: str, workspace: str):
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")

View File

@@ -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):
"""Testing if LLM can read a file"""

View 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]