From 483591f36ad6503559ddff933afd84b79ad704fc Mon Sep 17 00:00:00 2001 From: lidia9 Date: Wed, 30 Apr 2025 12:35:40 +0200 Subject: [PATCH] adding fake openai api key --- tests/tools/test_tool_generic_linux_command.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/tools/test_tool_generic_linux_command.py b/tests/tools/test_tool_generic_linux_command.py index c4c427c2..e4852f8e 100644 --- a/tests/tools/test_tool_generic_linux_command.py +++ b/tests/tools/test_tool_generic_linux_command.py @@ -1,11 +1,11 @@ -""" -This module contains tests for the generic Linux command tool functionality. -It includes tests for executing regular commands and handling invalid commands. -""" - +import os import pytest import json from unittest.mock import MagicMock + +# Set test environment variables to avoid OpenAI client initialization errors +os.environ["OPENAI_API_KEY"] = "test_key_for_ci_environment" + from cai.tools.reconnaissance.generic_linux_command import generic_linux_command async def test_generic_linux_command_regular_commands(): @@ -48,4 +48,4 @@ async def test_generic_linux_command_invalid_command(): result = await generic_linux_command.on_invoke_tool(mock_ctx, json.dumps(params)) # Assert that the result indicates the command was not found - assert "not found" in result + assert "not found" in result \ No newline at end of file