diff options
author | Reinier van der Leer <pwuts@agpt.co> | 2024-03-20 12:46:30 +0100 |
---|---|---|
committer | Reinier van der Leer <pwuts@agpt.co> | 2024-03-20 17:23:14 +0100 |
commit | e985f7c1053605252e374df6abd0d83a0d15f8ec (patch) | |
tree | c17fe4784e452dcd9c2f845ed5d7b73d7b365cf1 | |
parent | fix(agent): Windows-proof file_operations (diff) | |
download | Auto-GPT-e985f7c1053605252e374df6abd0d83a0d15f8ec.tar.gz Auto-GPT-e985f7c1053605252e374df6abd0d83a0d15f8ec.tar.bz2 Auto-GPT-e985f7c1053605252e374df6abd0d83a0d15f8ec.zip |
test(agent): Add skip statements to test_execute_code.py for when Docker is not available
-rw-r--r-- | autogpts/autogpt/tests/integration/test_execute_code.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/autogpts/autogpt/tests/integration/test_execute_code.py b/autogpts/autogpt/tests/integration/test_execute_code.py index 1c980e025..b8667b475 100644 --- a/autogpts/autogpt/tests/integration/test_execute_code.py +++ b/autogpts/autogpt/tests/integration/test_execute_code.py @@ -44,6 +44,9 @@ def random_string(): def test_execute_python_file(python_test_file: Path, random_string: str, agent: Agent): + if not (sut.is_docker_available() or sut.we_are_running_in_a_docker_container()): + pytest.skip("Docker is not available") + result: str = sut.execute_python_file(python_test_file, agent=agent) assert result.replace("\r", "") == f"Hello {random_string}!\n" @@ -51,6 +54,9 @@ def test_execute_python_file(python_test_file: Path, random_string: str, agent: def test_execute_python_file_args( python_test_args_file: Path, random_string: str, agent: Agent ): + if not (sut.is_docker_available() or sut.we_are_running_in_a_docker_container()): + pytest.skip("Docker is not available") + random_args = [random_string] * 2 random_args_string = " ".join(random_args) result = sut.execute_python_file( @@ -60,6 +66,9 @@ def test_execute_python_file_args( def test_execute_python_code(random_code: str, random_string: str, agent: Agent): + if not (sut.is_docker_available() or sut.we_are_running_in_a_docker_container()): + pytest.skip("Docker is not available") + result: str = sut.execute_python_code(random_code, agent=agent) assert result.replace("\r", "") == f"Hello {random_string}!\n" |