Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Sep 9, 2023
1 parent 5c0b78f commit 649d857
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions autogpts/autogpt/tests/integration/test_execute_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def test_execute_python_file(python_test_file: Path, random_string: str, agent:


def test_execute_python_file_args(
config: Config, python_test_args_file: Path, random_string: str
python_test_args_file: Path, random_string: str, agent: Agent
):
random_args = [random_string] * 2
random_args_string = " ".join(random_args)
result = sut.execute_python_file(python_test_args_file, config, random_args)
result = sut.execute_python_file(python_test_args_file, agent=agent, random_args)
assert result == f"{random_args_string}\n"


Expand All @@ -65,13 +65,6 @@ def test_execute_python_code(random_code: str, random_string: str, agent: Agent)
assert result.replace("\r", "") == f"Hello {random_string}!\n"


def test_execute_python_code_disallows_name_arg_path_traversal(
random_code: str, agent: Agent
):
with pytest.raises(AccessDeniedError, match="path traversal"):
sut.execute_python_code(random_code, agent=agent)


def test_execute_python_code_overwrites_file(random_code: str, agent: Agent):
ai_name = agent.ai_config.ai_name
destination = os.path.join(
Expand Down

0 comments on commit 649d857

Please sign in to comment.