Skip to content

Commit 422e5c3

Browse files
TaylorTaylor
authored andcommitted
Ran black on changed files
1 parent 5dc2b4f commit 422e5c3

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def mock_blob_container_client(monkeypatch):
379379
"AZURE_OPENAI_SEARCHAGENT_MODEL": "gpt-4.1-mini",
380380
"AZURE_OPENAI_SEARCHAGENT_DEPLOYMENT": "gpt-4.1-mini",
381381
"USE_AGENTIC_RETRIEVAL": "true",
382-
"ENABLE_AGENTIC_REF_HYDRATION": "true"
382+
"ENABLE_AGENTIC_REF_HYDRATION": "true",
383383
}
384384
]
385385

tests/mocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def __init__(self, search_text, vector_queries: Optional[list[VectorQuery]]):
160160
"@search.captions": [],
161161
},
162162
{
163-
"id": "doc2",
163+
"id": "doc2",
164164
"content": "Hydrated content 2",
165165
"sourcepage": "page2.pdf",
166166
"sourcefile": "file2.pdf",

tests/test_chatapproach.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def chat_approach_with_hydration():
7474
)
7575

7676

77-
7877
def test_get_search_query(chat_approach):
7978
payload = """
8079
{
@@ -331,16 +330,12 @@ async def test_agent_retrieval_results(monkeypatch):
331330
@pytest.mark.asyncio
332331
async def test_agentic_retrieval_without_hydration(chat_approach, monkeypatch):
333332
"""Test agentic retrieval without hydration"""
334-
333+
335334
agent_client = KnowledgeAgentRetrievalClient(endpoint="", agent_name="", credential=AzureKeyCredential(""))
336335

337336
monkeypatch.setattr(KnowledgeAgentRetrievalClient, "retrieve", mock_retrieval)
338337

339-
_, results = await chat_approach.run_agentic_retrieval(
340-
messages=[],
341-
agent_client=agent_client,
342-
search_index_name=""
343-
)
338+
_, results = await chat_approach.run_agentic_retrieval(messages=[], agent_client=agent_client, search_index_name="")
344339

345340
assert len(results) == 1
346341
assert results[0].id == "Benefit_Options-2.pdf"
@@ -349,9 +344,9 @@ async def test_agentic_retrieval_without_hydration(chat_approach, monkeypatch):
349344
assert results[0].sourcepage == "Benefit_Options-2.pdf"
350345
assert results[0].search_agent_query == "whistleblower query"
351346
# These fields should NOT be present without hydration
352-
assert not hasattr(results[0], 'sourcefile') or results[0].sourcefile is None
353-
assert not hasattr(results[0], 'category') or results[0].category is None
354-
assert not hasattr(results[0], 'score') or results[0].score is None
347+
assert not hasattr(results[0], "sourcefile") or results[0].sourcefile is None
348+
assert not hasattr(results[0], "category") or results[0].category is None
349+
assert not hasattr(results[0], "score") or results[0].score is None
355350

356351

357352
async def mock_search_with_hydration(*args, **kwargs):
@@ -362,17 +357,15 @@ async def mock_search_with_hydration(*args, **kwargs):
362357
@pytest.mark.asyncio
363358
async def test_agentic_retrieval_with_hydration(chat_approach_with_hydration, monkeypatch):
364359
"""Test agentic retrieval with hydration enabled"""
365-
360+
366361
agent_client = KnowledgeAgentRetrievalClient(endpoint="", agent_name="", credential=AzureKeyCredential(""))
367362

368363
# Mock the agent retrieval and search client
369364
monkeypatch.setattr(KnowledgeAgentRetrievalClient, "retrieve", mock_retrieval)
370365
monkeypatch.setattr(SearchClient, "search", mock_search_with_hydration)
371366

372367
_, results = await chat_approach_with_hydration.run_agentic_retrieval(
373-
messages=[],
374-
agent_client=agent_client,
375-
search_index_name=""
368+
messages=[], agent_client=agent_client, search_index_name=""
376369
)
377370

378371
assert len(results) == 1

0 commit comments

Comments
 (0)