@@ -35,9 +35,9 @@ def test_analyze_issue_client(client: TestClient, session: Session):
3535 repository .add (test_issue )
3636 repository .commit ()
3737
38- response = client .post ("/issues/1/analyze" )
39- # assert response.status_code == 200
40- assert response .json () == {"version" : 1 , "issue_number" : 1 }
38+ response = client .post ("/v1/ issues/1/analyze" )
39+ assert response .status_code == 200
40+ assert response .json () == {"issue_state" : "OPEN" , " version" : 0 , "issue_number" : 1 }
4141
4242
4343def test_analyze_issue_not_found (client : TestClient , session : Session ):
@@ -53,15 +53,14 @@ def test_analyze_issue_not_found(client: TestClient, session: Session):
5353 use_case .analyze ()
5454 assert exc_info .value .message == "Issue not found"
5555
56- response = client .post ("/issues/1/analyze" )
56+ response = client .post ("/v1/ issues/1/analyze" )
5757 assert response .status_code == 404
58- assert response .json () == {"version" : 1 , "issue_number" : 1 }
5958
6059
6160def test_analyze_issue_invalid_number (client : TestClient , session : Session ):
6261 """Test analyzing an issue with an invalid issue number."""
6362
64- response = client .post ("/issues/abc/analyze" )
63+ response = client .post ("/v1/ issues/abc/analyze" )
6564 assert response .status_code == 422
6665 # Validate error response structure
6766 error_detail = response .json ()["detail" ]
@@ -72,6 +71,6 @@ def test_analyze_issue_invalid_number(client: TestClient, session: Session):
7271
7372def test_analyze_issue_unauthorized (client : TestClient ):
7473 # Test case 3: Unauthorized access
75- response = client .post ("/issues/456/analyze" )
74+ response = client .post ("/v1/ issues/456/analyze" )
7675 assert response .status_code == 401
77- assert response .js_on () == {"detail" : "Unauthorized" }
76+ assert response .json () == {"detail" : "Unauthorized" }
0 commit comments