Skip to content

Commit 69105cb

Browse files
Om Kutegemini-code-assist[bot]
andauthored
Update tests/unittests/tools/test_vertex_ai_search_tool.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent e10a710 commit 69105cb

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/unittests/tools/test_vertex_ai_search_tool.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,17 @@ async def test_process_llm_request_with_simple_gemini_model(self, caplog):
215215
assert retrieval_tool.retrieval.vertex_ai_search.data_store_specs is None
216216

217217
# Check for debug log message and its components
218-
debug_messages = [
219-
r.message for r in caplog.records if r.levelno == logging.DEBUG
218+
debug_records = [
219+
r for r in caplog.records if 'Adding Vertex AI Search tool config' in r.message
220220
]
221-
debug_message = '\n'.join(debug_messages)
222-
assert 'Adding Vertex AI Search tool config to LLM request' in debug_message
223-
assert 'datastore=test_data_store' in debug_message
224-
assert 'engine=None' in debug_message
225-
assert 'filter=f' in debug_message
226-
assert 'max_results=5' in debug_message
227-
assert 'data_store_specs=None' in debug_message
221+
assert len(debug_records) == 1
222+
log_message = debug_records[0].getMessage()
223+
assert 'Adding Vertex AI Search tool config to LLM request' in log_message
224+
assert 'datastore=test_data_store' in log_message
225+
assert 'engine=None' in log_message
226+
assert 'filter=f' in log_message
227+
assert 'max_results=5' in log_message
228+
assert 'data_store_specs=None' in log_message
228229

229230
@pytest.mark.asyncio
230231
async def test_process_llm_request_with_path_based_gemini_model(self, caplog):

0 commit comments

Comments
 (0)