Skip to content

Commit 166cd87

Browse files
committed
🧪 Fix test file
1 parent 7ae7ab9 commit 166cd87

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

‎test/sdk/core/utils/test_prompt_template_utils.py‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,6 @@ def test_get_prompt_template_unsupported_type(self):
8686
assert "Unsupported template type" in str(excinfo.value)
8787
assert "unsupported_type" in str(excinfo.value)
8888

89-
@patch('builtins.open', new_callable=mock_open, read_data='system_prompt: "Test prompt"')
90-
@patch('yaml.safe_load')
91-
def test_get_prompt_template_with_kwargs(self, mock_yaml_load, mock_file):
92-
"""Test get_prompt_template with additional kwargs (should be logged but not used)"""
93-
mock_yaml_load.return_value = {"system_prompt": "Test prompt"}
94-
95-
with patch('sdk.nexent.core.utils.prompt_template_utils.logger') as mock_logger:
96-
result = get_prompt_template(template_type='analyze_image', language='en', extra_param='value')
97-
98-
# Verify kwargs were logged
99-
log_calls = [str(call) for call in mock_logger.info.call_args_list]
100-
assert any("extra_param" in str(call) or "kwargs" in str(call) for call in log_calls)
101-
102-
# Verify function still works
103-
assert result == {"system_prompt": "Test prompt"}
104-
10589
@patch('builtins.open', side_effect=FileNotFoundError("File not found"))
10690
def test_get_prompt_template_file_not_found(self, mock_file):
10791
"""Test get_prompt_template when template file is not found"""
@@ -119,21 +103,6 @@ def test_get_prompt_template_yaml_error(self, mock_yaml_load, mock_file):
119103

120104
assert "YAML parse error" in str(excinfo.value)
121105

122-
@patch('builtins.open', new_callable=mock_open, read_data='system_prompt: "Test prompt"')
123-
@patch('yaml.safe_load')
124-
@patch('sdk.nexent.core.utils.prompt_template_utils.logger')
125-
def test_get_prompt_template_logging(self, mock_logger, mock_yaml_load, mock_file):
126-
"""Test that get_prompt_template logs correctly"""
127-
mock_yaml_load.return_value = {"system_prompt": "Test prompt"}
128-
129-
get_prompt_template(template_type='analyze_image', language='en')
130-
131-
# Verify logger was called
132-
mock_logger.info.assert_called_once()
133-
log_call = str(mock_logger.info.call_args)
134-
assert "analyze_image" in log_call
135-
assert "en" in log_call
136-
137106
@patch('builtins.open', new_callable=mock_open, read_data='system_prompt: "Test prompt"')
138107
@patch('yaml.safe_load')
139108
def test_get_prompt_template_path_construction(self, mock_yaml_load, mock_file):

0 commit comments

Comments
 (0)