Skip to content

Commit 607acc6

Browse files
committed
fix these tests too
1 parent f16fda0 commit 607acc6

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

tests/sentry/api/endpoints/test_group_ai_autofix.py

+24-24
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ def test_ai_autofix_post_endpoint(
314314
mock_call.assert_called_once()
315315

316316
# Check individual parameters that we care about
317-
call_args = mock_call.call_args[0]
318-
assert call_args[1].id == group.id # Check that the group object matches
317+
call_kwargs = mock_call.call_args.kwargs
318+
assert call_kwargs["group"].id == group.id # Check that the group object matches
319319

320320
# Check that the repos parameter contains the expected data
321321
expected_repo = {
@@ -324,16 +324,16 @@ def test_ai_autofix_post_endpoint(
324324
"name": "sentry",
325325
"external_id": "123",
326326
}
327-
assert expected_repo in call_args[2]
327+
assert expected_repo in call_kwargs["repos"]
328328

329329
# Check that the instruction was passed correctly
330-
assert call_args[6] == "Yes"
330+
assert call_kwargs["instruction"] == "Yes"
331331

332332
# Check other parameters
333-
assert call_args[7] == TIMEOUT_SECONDS
333+
assert call_kwargs["timeout_secs"] == TIMEOUT_SECONDS
334334

335335
# Verify that the serialized event has an exception entry
336-
serialized_event_arg = call_args[3]
336+
serialized_event_arg = call_kwargs["serialized_event"]
337337
assert any(
338338
[entry.get("type") == "exception" for entry in serialized_event_arg.get("entries", [])]
339339
)
@@ -387,20 +387,20 @@ def test_ai_autofix_post_without_code_mappings(
387387
mock_call.assert_called_once()
388388

389389
# Check individual parameters that we care about
390-
call_args = mock_call.call_args[0]
391-
assert call_args[1].id == group.id # Check that the group object matches
390+
call_kwargs = mock_call.call_args.kwargs
391+
assert call_kwargs["group"].id == group.id # Check that the group object matches
392392

393393
# Check that the repos parameter is an empty list (no code mappings)
394-
assert call_args[2] == []
394+
assert call_kwargs["repos"] == []
395395

396396
# Check that the instruction was passed correctly
397-
assert call_args[6] == "Yes"
397+
assert call_kwargs["instruction"] == "Yes"
398398

399399
# Check other parameters
400-
assert call_args[7] == TIMEOUT_SECONDS
400+
assert call_kwargs["timeout_secs"] == TIMEOUT_SECONDS
401401

402402
# Verify that the serialized event has an exception entry
403-
serialized_event_arg = call_args[3]
403+
serialized_event_arg = call_kwargs["serialized_event"]
404404
assert any(
405405
[entry.get("type") == "exception" for entry in serialized_event_arg.get("entries", [])]
406406
)
@@ -460,8 +460,8 @@ def test_ai_autofix_post_without_event_id(
460460
mock_call.assert_called_once()
461461

462462
# Check individual parameters that we care about
463-
call_args = mock_call.call_args[0]
464-
assert call_args[1].id == group.id # Check that the group object matches
463+
call_kwargs = mock_call.call_args.kwargs
464+
assert call_kwargs["group"].id == group.id # Check that the group object matches
465465

466466
# Check that the repos parameter contains the expected data
467467
expected_repo = {
@@ -470,16 +470,16 @@ def test_ai_autofix_post_without_event_id(
470470
"name": "sentry",
471471
"external_id": "123",
472472
}
473-
assert expected_repo in call_args[2]
473+
assert expected_repo in call_kwargs["repos"]
474474

475475
# Check that the instruction was passed correctly
476-
assert call_args[6] == "Yes"
476+
assert call_kwargs["instruction"] == "Yes"
477477

478478
# Check other parameters
479-
assert call_args[7] == TIMEOUT_SECONDS
479+
assert call_kwargs["timeout_secs"] == TIMEOUT_SECONDS
480480

481481
# Verify that the serialized event has an exception entry
482-
serialized_event_arg = call_args[3]
482+
serialized_event_arg = call_kwargs["serialized_event"]
483483
assert any(
484484
[entry.get("type") == "exception" for entry in serialized_event_arg.get("entries", [])]
485485
)
@@ -539,8 +539,8 @@ def test_ai_autofix_post_without_event_id_no_recommended_event(
539539
mock_call.assert_called_once()
540540

541541
# Check individual parameters that we care about
542-
call_args = mock_call.call_args[0]
543-
assert call_args[1].id == group.id # Check that the group object matches
542+
call_kwargs = mock_call.call_args.kwargs
543+
assert call_kwargs["group"].id == group.id # Check that the group object matches
544544

545545
# Check that the repos parameter contains the expected data
546546
expected_repo = {
@@ -549,16 +549,16 @@ def test_ai_autofix_post_without_event_id_no_recommended_event(
549549
"name": "sentry",
550550
"external_id": "123",
551551
}
552-
assert expected_repo in call_args[2]
552+
assert expected_repo in call_kwargs["repos"]
553553

554554
# Check that the instruction was passed correctly
555-
assert call_args[6] == "Yes"
555+
assert call_kwargs["instruction"] == "Yes"
556556

557557
# Check other parameters
558-
assert call_args[7] == TIMEOUT_SECONDS
558+
assert call_kwargs["timeout_secs"] == TIMEOUT_SECONDS
559559

560560
# Verify that the serialized event has an exception entry
561-
serialized_event_arg = call_args[3]
561+
serialized_event_arg = call_kwargs["serialized_event"]
562562
assert any(
563563
[entry.get("type") == "exception" for entry in serialized_event_arg.get("entries", [])]
564564
)

0 commit comments

Comments
 (0)