@@ -167,6 +167,7 @@ def test_is_transcripts_disabled(setup_configuration, mocker) -> None:
167167 assert is_transcripts_enabled () is False , "Transcripts should be disabled"
168168
169169
170+ # pylint: disable=too-many-locals
170171async def _test_query_endpoint_handler (
171172 mocker , dummy_request : Request , store_transcript_to_file = False
172173) -> None :
@@ -184,12 +185,16 @@ async def _test_query_endpoint_handler(
184185 store_transcript_to_file
185186 )
186187 mocker .patch ("app.endpoints.query.configuration" , mock_config )
187-
188- mock_store_in_cache = mocker .patch ("app.endpoints.query.store_conversation_into_cache" )
188+
189+ mock_store_in_cache = mocker .patch (
190+ "app.endpoints.query.store_conversation_into_cache"
191+ )
189192
190193 # Create mock referenced documents to simulate a successful RAG response
191194 mock_referenced_documents = [
192- ReferencedDocument (doc_title = "Test Doc 1" , doc_url = AnyUrl ("http://example.com/1" ))
195+ ReferencedDocument (
196+ doc_title = "Test Doc 1" , doc_url = AnyUrl ("http://example.com/1" )
197+ )
193198 ]
194199
195200 summary = TurnSummary (
@@ -208,7 +213,12 @@ async def _test_query_endpoint_handler(
208213
209214 mocker .patch (
210215 "app.endpoints.query.retrieve_response" ,
211- return_value = (summary , conversation_id , mock_referenced_documents , TokenCounter ()),
216+ return_value = (
217+ summary ,
218+ conversation_id ,
219+ mock_referenced_documents ,
220+ TokenCounter (),
221+ ),
212222 )
213223 mocker .patch (
214224 "app.endpoints.query.select_model_and_provider_id" ,
@@ -237,11 +247,12 @@ async def _test_query_endpoint_handler(
237247 # Assert the response is as expected
238248 assert response .response == summary .llm_response
239249 assert response .conversation_id == conversation_id
240-
250+
241251 # Assert that mock was called and get the arguments
242252 mock_store_in_cache .assert_called_once ()
243253 call_args = mock_store_in_cache .call_args [0 ]
244- # Extract CacheEntry object from the call arguments, it's the 4th argument from the func signature
254+ # Extract CacheEntry object from the call arguments,
255+ # it's the 4th argument from the func signature
245256 cached_entry = call_args [3 ]
246257
247258 assert isinstance (cached_entry , CacheEntry )
0 commit comments