Skip to content

Commit 791473a

Browse files
committed
lint
Signed-off-by: Anxhela Coba <acoba@redhat.com>
1 parent 5a22239 commit 791473a

5 files changed

Lines changed: 41 additions & 8 deletions

File tree

tests/unit/app/endpoints/test_query.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ async def test_query_merges_inline_and_tool_rag_chunks_and_documents(
212212
)
213213

214214
inline_chunk = RAGChunk(content="inline chunk content", source="byok")
215-
inline_doc = ReferencedDocument(doc_title="Inline Doc", document_id="inline_doc_1")
215+
inline_doc = ReferencedDocument(
216+
doc_title="Inline Doc", document_id="inline_doc_1"
217+
)
216218
inline_rag = RAGContext(
217219
context_text="",
218220
rag_chunks=[inline_chunk],

tests/unit/cache/test_postgres_cache.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,11 @@ def test_insert_and_get_with_referenced_documents(
637637

638638
# Create a CacheEntry with referenced documents
639639
docs = [
640-
ReferencedDocument(doc_title="Test Doc", doc_url=AnyUrl("http://example.com/"), document_id="test_doc_postgres_1")
640+
ReferencedDocument(
641+
doc_title="Test Doc",
642+
doc_url=AnyUrl("http://example.com/"),
643+
document_id="test_doc_postgres_1",
644+
)
641645
]
642646
entry_with_docs = CacheEntry(
643647
query="user message",
@@ -664,7 +668,12 @@ def test_insert_and_get_with_referenced_documents(
664668
inserted_json_str = sql_params[-3]
665669

666670
assert json.loads(inserted_json_str) == [
667-
{"doc_url": "http://example.com/", "doc_title": "Test Doc", "source": None, "document_id": "test_doc_postgres_1"}
671+
{
672+
"doc_url": "http://example.com/",
673+
"doc_title": "Test Doc",
674+
"source": None,
675+
"document_id": "test_doc_postgres_1",
676+
}
668677
]
669678

670679
# Simulate the database returning that data
@@ -675,7 +684,13 @@ def test_insert_and_get_with_referenced_documents(
675684
"bar",
676685
"start_time",
677686
"end_time",
678-
[{"doc_url": "http://example.com/", "doc_title": "Test Doc", "document_id": "test_doc_postgres_1"}],
687+
[
688+
{
689+
"doc_url": "http://example.com/",
690+
"doc_title": "Test Doc",
691+
"document_id": "test_doc_postgres_1",
692+
}
693+
],
679694
None, # tool_calls
680695
None, # tool_results
681696
)

tests/unit/cache/test_sqlite_cache.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,11 @@ def test_insert_and_get_with_referenced_documents(tmpdir: Path) -> None:
467467

468468
# Create a CacheEntry with referenced documents
469469
docs = [
470-
ReferencedDocument(doc_title="Test Doc", doc_url=AnyUrl("http://example.com"), document_id="test_doc_cache_1")
470+
ReferencedDocument(
471+
doc_title="Test Doc",
472+
doc_url=AnyUrl("http://example.com"),
473+
document_id="test_doc_cache_1",
474+
)
471475
]
472476
entry_with_docs = CacheEntry(
473477
query="user message",
@@ -571,7 +575,11 @@ def test_insert_and_get_with_all_fields(tmpdir: Path) -> None:
571575

572576
# Create all fields
573577
docs = [
574-
ReferencedDocument(doc_title="Test Doc", doc_url=AnyUrl("http://example.com"), document_id="test_doc_cache_1")
578+
ReferencedDocument(
579+
doc_title="Test Doc",
580+
doc_url=AnyUrl("http://example.com"),
581+
document_id="test_doc_cache_1",
582+
)
575583
]
576584
tool_calls = [
577585
ToolCallSummary(

tests/unit/models/responses/test_successful_responses.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,11 @@ def test_constructor_full(self) -> None:
321321
)
322322
]
323323
referenced_docs = [
324-
ReferencedDocument(doc_url=AnyUrl("https://example.com"), doc_title="Doc", document_id="test_doc_1")
324+
ReferencedDocument(
325+
doc_url=AnyUrl("https://example.com"),
326+
doc_title="Doc",
327+
document_id="test_doc_1",
328+
)
325329
]
326330

327331
response = QueryResponse( # type: ignore[call-arg]

tests/unit/utils/test_responses.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2130,7 +2130,11 @@ def test_parse_referenced_documents_file_search_call(
21302130
}
21312131

21322132
mock_result2 = {
2133-
"attributes": {"url": "https://example.com/doc2", "title": "Document 2", "doc_id": "doc_2"},
2133+
"attributes": {
2134+
"url": "https://example.com/doc2",
2135+
"title": "Document 2",
2136+
"doc_id": "doc_2",
2137+
},
21342138
}
21352139

21362140
mock_output_item = mocker.Mock()

0 commit comments

Comments
 (0)