@@ -68,10 +68,10 @@ def test_syncs_participants_from_slack_channel(self):
6868
6969 stats = sync_incident_participants_from_slack (incident )
7070
71- assert stats [ " added" ] == 2
72- assert stats [ " already_existed" ] == 0
73- assert stats [ " errors" ] == []
74- assert stats [ " skipped" ] is False
71+ assert stats . added == 2
72+ assert stats . already_existed == 0
73+ assert stats . errors == []
74+ assert stats . skipped is False
7575
7676 assert incident .participants .count () == 3
7777 assert slack_user1 in incident .participants .all ()
@@ -139,8 +139,8 @@ def test_throttle_skips_recent_sync(self):
139139
140140 stats = sync_incident_participants_from_slack (incident )
141141
142- assert stats [ " skipped" ] is True
143- assert stats [ " added" ] == 0
142+ assert stats . skipped is True
143+ assert stats . added == 0
144144
145145 def test_force_bypasses_throttle (self ):
146146 incident = Incident .objects .create (
@@ -177,8 +177,8 @@ def test_force_bypasses_throttle(self):
177177
178178 stats = sync_incident_participants_from_slack (incident , force = True )
179179
180- assert stats [ " skipped" ] is False
181- assert stats [ " added" ] == 1
180+ assert stats . skipped is False
181+ assert stats . added == 1
182182
183183 def test_handles_missing_slack_link (self ):
184184 incident = Incident .objects .create (
@@ -189,9 +189,9 @@ def test_handles_missing_slack_link(self):
189189
190190 stats = sync_incident_participants_from_slack (incident )
191191
192- assert stats [ " added" ] == 0
193- assert len (stats [ " errors" ] ) == 1
194- assert "No Slack link" in stats [ " errors" ] [0 ]
192+ assert stats . added == 0
193+ assert len (stats . errors ) == 1
194+ assert "No Slack link" in stats . errors [0 ]
195195
196196 def test_handles_invalid_channel_url (self ):
197197 incident = Incident .objects .create (
@@ -212,9 +212,9 @@ def test_handles_invalid_channel_url(self):
212212
213213 stats = sync_incident_participants_from_slack (incident )
214214
215- assert stats [ " added" ] == 0
216- assert len (stats [ " errors" ] ) == 1
217- assert "Could not parse channel ID" in stats [ " errors" ] [0 ]
215+ assert stats . added == 0
216+ assert len (stats . errors ) == 1
217+ assert "Could not parse channel ID" in stats . errors [0 ]
218218
219219 def test_handles_slack_api_failure (self ):
220220 incident = Incident .objects .create (
@@ -240,9 +240,9 @@ def test_handles_slack_api_failure(self):
240240
241241 stats = sync_incident_participants_from_slack (incident )
242242
243- assert stats [ " added" ] == 0
244- assert len (stats [ " errors" ] ) == 1
245- assert "Failed to fetch channel members" in stats [ " errors" ] [0 ]
243+ assert stats . added == 0
244+ assert len (stats . errors ) == 1
245+ assert "Failed to fetch channel members" in stats . errors [0 ]
246246
247247 def test_handles_user_creation_failure (self ):
248248 incident = Incident .objects .create (
@@ -273,9 +273,9 @@ def test_handles_user_creation_failure(self):
273273
274274 stats = sync_incident_participants_from_slack (incident )
275275
276- assert stats [ " added" ] == 0
277- assert len (stats [ " errors" ] ) == 1
278- assert "Could not get/create user" in stats [ " errors" ] [0 ]
276+ assert stats . added == 0
277+ assert len (stats . errors ) == 1
278+ assert "Could not get/create user" in stats . errors [0 ]
279279
280280 def test_counts_already_existed_participants (self ):
281281 incident = Incident .objects .create (
@@ -312,8 +312,8 @@ def test_counts_already_existed_participants(self):
312312
313313 stats = sync_incident_participants_from_slack (incident )
314314
315- assert stats [ " added" ] == 0
316- assert stats [ " already_existed" ] == 1
315+ assert stats . added == 0
316+ assert stats . already_existed == 1
317317 assert incident .participants .count () == 1
318318
319319 def test_skips_bots (self ):
@@ -357,5 +357,5 @@ def test_skips_bots(self):
357357
358358 assert mock_get_user .call_count == 1
359359 mock_get_user .assert_called_once_with ("U11111" )
360- assert stats [ " added" ] == 1
361- assert stats [ " errors" ] == []
360+ assert stats . added == 1
361+ assert stats . errors == []
0 commit comments