@@ -314,8 +314,8 @@ def test_ai_autofix_post_endpoint(
314
314
mock_call .assert_called_once ()
315
315
316
316
# 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
319
319
320
320
# Check that the repos parameter contains the expected data
321
321
expected_repo = {
@@ -324,16 +324,16 @@ def test_ai_autofix_post_endpoint(
324
324
"name" : "sentry" ,
325
325
"external_id" : "123" ,
326
326
}
327
- assert expected_repo in call_args [ 2 ]
327
+ assert expected_repo in call_kwargs [ "repos" ]
328
328
329
329
# Check that the instruction was passed correctly
330
- assert call_args [ 6 ] == "Yes"
330
+ assert call_kwargs [ "instruction" ] == "Yes"
331
331
332
332
# Check other parameters
333
- assert call_args [ 7 ] == TIMEOUT_SECONDS
333
+ assert call_kwargs [ "timeout_secs" ] == TIMEOUT_SECONDS
334
334
335
335
# Verify that the serialized event has an exception entry
336
- serialized_event_arg = call_args [ 3 ]
336
+ serialized_event_arg = call_kwargs [ "serialized_event" ]
337
337
assert any (
338
338
[entry .get ("type" ) == "exception" for entry in serialized_event_arg .get ("entries" , [])]
339
339
)
@@ -387,20 +387,20 @@ def test_ai_autofix_post_without_code_mappings(
387
387
mock_call .assert_called_once ()
388
388
389
389
# 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
392
392
393
393
# Check that the repos parameter is an empty list (no code mappings)
394
- assert call_args [ 2 ] == []
394
+ assert call_kwargs [ "repos" ] == []
395
395
396
396
# Check that the instruction was passed correctly
397
- assert call_args [ 6 ] == "Yes"
397
+ assert call_kwargs [ "instruction" ] == "Yes"
398
398
399
399
# Check other parameters
400
- assert call_args [ 7 ] == TIMEOUT_SECONDS
400
+ assert call_kwargs [ "timeout_secs" ] == TIMEOUT_SECONDS
401
401
402
402
# Verify that the serialized event has an exception entry
403
- serialized_event_arg = call_args [ 3 ]
403
+ serialized_event_arg = call_kwargs [ "serialized_event" ]
404
404
assert any (
405
405
[entry .get ("type" ) == "exception" for entry in serialized_event_arg .get ("entries" , [])]
406
406
)
@@ -460,8 +460,8 @@ def test_ai_autofix_post_without_event_id(
460
460
mock_call .assert_called_once ()
461
461
462
462
# 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
465
465
466
466
# Check that the repos parameter contains the expected data
467
467
expected_repo = {
@@ -470,16 +470,16 @@ def test_ai_autofix_post_without_event_id(
470
470
"name" : "sentry" ,
471
471
"external_id" : "123" ,
472
472
}
473
- assert expected_repo in call_args [ 2 ]
473
+ assert expected_repo in call_kwargs [ "repos" ]
474
474
475
475
# Check that the instruction was passed correctly
476
- assert call_args [ 6 ] == "Yes"
476
+ assert call_kwargs [ "instruction" ] == "Yes"
477
477
478
478
# Check other parameters
479
- assert call_args [ 7 ] == TIMEOUT_SECONDS
479
+ assert call_kwargs [ "timeout_secs" ] == TIMEOUT_SECONDS
480
480
481
481
# Verify that the serialized event has an exception entry
482
- serialized_event_arg = call_args [ 3 ]
482
+ serialized_event_arg = call_kwargs [ "serialized_event" ]
483
483
assert any (
484
484
[entry .get ("type" ) == "exception" for entry in serialized_event_arg .get ("entries" , [])]
485
485
)
@@ -539,8 +539,8 @@ def test_ai_autofix_post_without_event_id_no_recommended_event(
539
539
mock_call .assert_called_once ()
540
540
541
541
# 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
544
544
545
545
# Check that the repos parameter contains the expected data
546
546
expected_repo = {
@@ -549,16 +549,16 @@ def test_ai_autofix_post_without_event_id_no_recommended_event(
549
549
"name" : "sentry" ,
550
550
"external_id" : "123" ,
551
551
}
552
- assert expected_repo in call_args [ 2 ]
552
+ assert expected_repo in call_kwargs [ "repos" ]
553
553
554
554
# Check that the instruction was passed correctly
555
- assert call_args [ 6 ] == "Yes"
555
+ assert call_kwargs [ "instruction" ] == "Yes"
556
556
557
557
# Check other parameters
558
- assert call_args [ 7 ] == TIMEOUT_SECONDS
558
+ assert call_kwargs [ "timeout_secs" ] == TIMEOUT_SECONDS
559
559
560
560
# Verify that the serialized event has an exception entry
561
- serialized_event_arg = call_args [ 3 ]
561
+ serialized_event_arg = call_kwargs [ "serialized_event" ]
562
562
assert any (
563
563
[entry .get ("type" ) == "exception" for entry in serialized_event_arg .get ("entries" , [])]
564
564
)
0 commit comments