1
1
from functools import cached_property
2
- from unittest .mock import patch
2
+ from unittest .mock import MagicMock , patch
3
3
4
4
import responses
5
5
16
16
17
17
18
18
class GroupNotesDetailsTest (APITestCase ):
19
- def setUp (self ):
19
+ def setUp (self ) -> None :
20
20
super ().setUp ()
21
21
self .activity .data ["external_id" ] = "123"
22
22
self .activity .save ()
@@ -43,10 +43,10 @@ def setUp(self):
43
43
)
44
44
45
45
@cached_property
46
- def url (self ):
46
+ def url (self ) -> str :
47
47
return f"/api/0/issues/{ self .group .id } /comments/{ self .activity .id } /"
48
48
49
- def test_delete (self ):
49
+ def test_delete (self ) -> None :
50
50
self .login_as (user = self .user )
51
51
52
52
url = self .url
@@ -59,7 +59,7 @@ def test_delete(self):
59
59
60
60
assert Group .objects .get (id = self .group .id ).num_comments == 0
61
61
62
- def test_delete_comment_and_subscription (self ):
62
+ def test_delete_comment_and_subscription (self ) -> None :
63
63
"""Test that if a user deletes their comment on an issue, we delete the subscription too"""
64
64
self .login_as (user = self .user )
65
65
event = self .store_event (data = {}, project_id = self .project .id )
@@ -91,7 +91,7 @@ def test_delete_comment_and_subscription(self):
91
91
reason = GroupSubscriptionReason .comment ,
92
92
).exists ()
93
93
94
- def test_delete_multiple_comments (self ):
94
+ def test_delete_multiple_comments (self ) -> None :
95
95
"""Test that if a user has commented multiple times on an issue and deletes one, we don't remove the subscription"""
96
96
self .login_as (user = self .user )
97
97
event = self .store_event (data = {}, project_id = self .project .id )
@@ -130,7 +130,7 @@ def test_delete_multiple_comments(self):
130
130
131
131
@patch ("sentry.integrations.mixins.issues.IssueBasicIntegration.update_comment" )
132
132
@responses .activate
133
- def test_put (self , mock_update_comment ) :
133
+ def test_put (self , mock_update_comment : MagicMock ) -> None :
134
134
self .login_as (user = self .user )
135
135
136
136
url = self .url
@@ -154,7 +154,7 @@ def test_put(self, mock_update_comment):
154
154
assert mock_update_comment .call_args [0 ][2 ] == activity
155
155
156
156
@responses .activate
157
- def test_put_ignore_mentions (self ):
157
+ def test_put_ignore_mentions (self ) -> None :
158
158
GroupLink .objects .filter (group_id = self .group .id ).delete ()
159
159
self .login_as (user = self .user )
160
160
@@ -179,7 +179,7 @@ def test_put_ignore_mentions(self):
179
179
}
180
180
181
181
@patch ("sentry.integrations.mixins.issues.IssueBasicIntegration.update_comment" )
182
- def test_put_no_external_id (self , mock_update_comment ) :
182
+ def test_put_no_external_id (self , mock_update_comment : MagicMock ) -> None :
183
183
del self .activity .data ["external_id" ]
184
184
self .activity .save ()
185
185
self .login_as (user = self .user )
0 commit comments