@@ -32,19 +32,7 @@ def setUp(self):
3232 )
3333 self .organization .update_option ("sentry:gen_ai_consent_v2024_11_14" , True )
3434
35- @patch (
36- "sentry.api.endpoints.group_autofix_setup_check.get_repos_and_access" ,
37- return_value = [
38- {
39- "provider" : "github" ,
40- "owner" : "getsentry" ,
41- "name" : "seer" ,
42- "external_id" : "123" ,
43- "ok" : True ,
44- }
45- ],
46- )
47- def test_successful_setup (self , mock_get_repos_and_access ):
35+ def test_successful_setup (self ):
4836 """
4937 Everything is set up correctly, should respond with OKs.
5038 """
@@ -63,18 +51,7 @@ def test_successful_setup(self, mock_get_repos_and_access):
6351 "ok" : True ,
6452 "reason" : None ,
6553 },
66- "githubWriteIntegration" : {
67- "ok" : True ,
68- "repos" : [
69- {
70- "provider" : "github" ,
71- "owner" : "getsentry" ,
72- "name" : "seer" ,
73- "external_id" : "123" ,
74- "ok" : True ,
75- }
76- ],
77- },
54+ "githubWriteIntegration" : None ,
7855 }
7956
8057 @patch (
@@ -89,13 +66,13 @@ def test_successful_setup(self, mock_get_repos_and_access):
8966 }
9067 ],
9168 )
92- def test_successful_with_codebase_indexing_disabled_flag (self , mock_get_repos_and_access ):
69+ def test_successful_with_write_access (self , mock_get_repos_and_access ):
9370 """
9471 Everything is set up correctly, should respond with OKs.
9572 """
9673 group = self .create_group ()
9774 self .login_as (user = self .user )
98- url = f"/api/0/issues/{ group .id } /autofix/setup/"
75+ url = f"/api/0/issues/{ group .id } /autofix/setup/?check_write_access=true "
9976 response = self .client .get (url , format = "json" )
10077
10178 assert response .status_code == 200
@@ -192,7 +169,7 @@ def test_missing_integration(self):
192169 def test_repo_write_access_not_ready (self , mock_get_repos_and_access ):
193170 group = self .create_group ()
194171 self .login_as (user = self .user )
195- url = f"/api/0/issues/{ group .id } /autofix/setup/"
172+ url = f"/api/0/issues/{ group .id } /autofix/setup/?check_write_access=true "
196173 response = self .client .get (url , format = "json" )
197174
198175 assert response .status_code == 200
@@ -223,7 +200,7 @@ def test_repo_write_access_not_ready(self, mock_get_repos_and_access):
223200 def test_repo_write_access_no_repos (self , mock_get_repos_and_access ):
224201 group = self .create_group ()
225202 self .login_as (user = self .user )
226- url = f"/api/0/issues/{ group .id } /autofix/setup/"
203+ url = f"/api/0/issues/{ group .id } /autofix/setup/?check_write_access=true "
227204 response = self .client .get (url , format = "json" )
228205
229206 assert response .status_code == 200
0 commit comments