@@ -32,9 +32,6 @@ def mock_static_files(mocker: MockerFixture) -> None:
3232 return mock_static
3333
3434
35-
36-
37-
3835@pytest .fixture (scope = "module" , autouse = True )
3936def cleanup_tmp_dir () -> Generator [None , None , None ]:
4037 """Remove ``/tmp/gitingest`` after this test-module is done."""
@@ -61,7 +58,7 @@ async def test_remote_repository_analysis(request: pytest.FixtureRequest) -> Non
6158
6259 response = client .post ("/api/ingest" , data = form_data )
6360 assert response .status_code == status .HTTP_200_OK , f"Form submission failed: { response .text } "
64-
61+
6562 # Check that response is JSON
6663 response_data = response .json ()
6764 assert "result" in response_data
@@ -87,7 +84,7 @@ async def test_invalid_repository_url(request: pytest.FixtureRequest) -> None:
8784 response = client .post ("/api/ingest" , data = form_data )
8885 # Should return 400 for invalid repository
8986 assert response .status_code == status .HTTP_400_BAD_REQUEST , f"Request failed: { response .text } "
90-
87+
9188 # Check that response is JSON error
9289 response_data = response .json ()
9390 assert "error" in response_data
@@ -108,8 +105,9 @@ async def test_large_repository(request: pytest.FixtureRequest) -> None:
108105
109106 response = client .post ("/api/ingest" , data = form_data )
110107 # This might fail with 400 if repo doesn't exist, or succeed with 200
111- assert response .status_code in [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ], f"Request failed: { response .text } "
112-
108+ _valid = [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ]
109+ assert response .status_code in _valid , f"Request failed: { response .text } "
110+
113111 response_data = response .json ()
114112 if response .status_code == status .HTTP_200_OK :
115113 assert "result" in response_data
@@ -132,8 +130,9 @@ def make_request() -> None:
132130 "token" : "" ,
133131 }
134132 response = client .post ("/api/ingest" , data = form_data )
135- assert response .status_code in [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ], f"Request failed: { response .text } "
136-
133+ _valid = [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ]
134+ assert response .status_code in _valid , f"Request failed: { response .text } "
135+
137136 response_data = response .json ()
138137 if response .status_code == status .HTTP_200_OK :
139138 assert "result" in response_data
@@ -160,8 +159,9 @@ async def test_large_file_handling(request: pytest.FixtureRequest) -> None:
160159 }
161160
162161 response = client .post ("/api/ingest" , data = form_data )
163- assert response .status_code in [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ], f"Request failed: { response .text } "
164-
162+ _valid = [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ]
163+ assert response .status_code in _valid , f"Request failed: { response .text } "
164+
165165 response_data = response .json ()
166166 if response .status_code == status .HTTP_200_OK :
167167 assert "result" in response_data
@@ -183,8 +183,9 @@ async def test_repository_with_patterns(request: pytest.FixtureRequest) -> None:
183183 }
184184
185185 response = client .post ("/api/ingest" , data = form_data )
186- assert response .status_code in [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ], f"Request failed: { response .text } "
187-
186+ _valid = [status .HTTP_200_OK , status .HTTP_400_BAD_REQUEST ]
187+ assert response .status_code in _valid , f"Request failed: { response .text } "
188+
188189 response_data = response .json ()
189190 if response .status_code == status .HTTP_200_OK :
190191 assert "result" in response_data
0 commit comments