@@ -32,7 +32,9 @@ def test_health(self):
3232
3333 def test_generate (self ):
3434 self .pipeline .generate .return_value = "Paris is the capital of France."
35- response = self .client .post ("/generate" , json = {"question" : "What is the capital of France?" })
35+ response = self .client .post (
36+ "/generate" , json = {"question" : "What is the capital of France?" }
37+ )
3638 self .assertEqual (response .status_code , 200 )
3739 self .assertEqual (response .json (), {"answer" : "Paris is the capital of France." })
3840 self .pipeline .generate .assert_called_once_with ("What is the capital of France?" )
@@ -56,7 +58,9 @@ def test_ingest_missing_params(self):
5658 response = self .client .post ("/ingest" , json = {})
5759 self .assertEqual (response .status_code , 400 )
5860 detail = response .json ()["detail" ]
59- self .assertTrue (any (k in detail for k in ("data_path" , "file_paths" , "github_url" )))
61+ self .assertTrue (
62+ any (k in detail for k in ("data_path" , "file_paths" , "github_url" ))
63+ )
6064
6165 def test_ingest_github (self ):
6266 self .vector_store .ingest .return_value = None
@@ -66,7 +70,10 @@ def test_ingest_github(self):
6670 MockScrapper .return_value = instance
6771 response = self .client .post (
6872 "/ingest" ,
69- json = {"github_url" : "https://github.com/example/repo" , "github_branch" : "main" },
73+ json = {
74+ "github_url" : "https://github.com/example/repo" ,
75+ "github_branch" : "main" ,
76+ },
7077 )
7178 self .assertEqual (response .status_code , 200 )
7279 instance .set_repositories .assert_called_once ()
@@ -88,7 +95,9 @@ def test_ingest_file_paths(self):
8895
8996 def test_ingest_file_paths_missing_file (self ):
9097 with patch ("os.path.isfile" , return_value = False ):
91- response = self .client .post ("/ingest" , json = {"file_paths" : ["/nonexistent/file.pdf" ]})
98+ response = self .client .post (
99+ "/ingest" , json = {"file_paths" : ["/nonexistent/file.pdf" ]}
100+ )
92101 self .assertEqual (response .status_code , 500 )
93102 self .assertIn ("not found" , response .json ()["detail" ].lower ())
94103
@@ -116,7 +125,10 @@ def test_ingest_upload_no_files(self):
116125 # ── /collections ──────────────────────────────────────────────────────────
117126
118127 def test_collections (self ):
119- self .vector_store .get_available_collections .return_value = ["default" , "project_x" ]
128+ self .vector_store .get_available_collections .return_value = [
129+ "default" ,
130+ "project_x" ,
131+ ]
120132 response = self .client .get ("/collections" )
121133 self .assertEqual (response .status_code , 200 )
122134 self .assertEqual (response .json (), {"collections" : ["default" , "project_x" ]})
0 commit comments