@@ -2494,13 +2494,6 @@ def test_dsm_set_checkpoint_exception_path(self):
24942494 self .mock_checkpoint .assert_called_once ()
24952495 self .mock_logger .debug .assert_called_once ()
24962496
2497- @patch ("ddtrace.data_streams.set_consume_checkpoint" )
2498- def test_dsm_set_checkpoint_non_dict_context (self , mock_checkpoint ):
2499- _dsm_set_checkpoint (
2500- "not_a_dict" , "sqs" , "arn:aws:sqs:us-east-1:123456789012:test-queue"
2501- )
2502- mock_checkpoint .assert_not_called ()
2503-
25042497 @patch ("ddtrace.data_streams.set_consume_checkpoint" )
25052498 def test_dsm_set_checkpoint_DSM_PROPAGATION_KEY_BASE_64_not_present (
25062499 self , mock_checkpoint
@@ -2532,6 +2525,7 @@ def test_sqs_event_with_datadog_message_attributes(
25322525 "messageAttributes" : {
25332526 "_datadog" : {"dataType" : "String" , "stringValue" : dd_json_data }
25342527 },
2528+ "eventSource" : "aws:sqs" ,
25352529 }
25362530 ]
25372531 }
@@ -2565,6 +2559,7 @@ def test_sqs_event_with_binary_datadog_message_attributes(
25652559 "messageAttributes" : {
25662560 "_datadog" : {"dataType" : "Binary" , "binaryValue" : encoded_data }
25672561 },
2562+ "eventSource" : "aws:sqs" ,
25682563 }
25692564 ]
25702565 }
@@ -2600,6 +2595,7 @@ def test_sns_event_with_datadog_message_attributes(
26002595 "_datadog" : {"Type" : "String" , "Value" : dd_json_data }
26012596 },
26022597 },
2598+ "eventSource" : "aws:sns" ,
26032599 }
26042600 ]
26052601 }
@@ -2633,6 +2629,7 @@ def test_sqs_event_determines_is_sqs_true_when_event_source_arn_present(
26332629 "messageAttributes" : {
26342630 "_datadog" : {"dataType" : "String" , "stringValue" : dd_json_data }
26352631 },
2632+ "eventSource" : "aws:sqs" ,
26362633 }
26372634 ]
26382635 }
@@ -2674,6 +2671,7 @@ def test_sns_to_sqs_event_detection_and_processing(
26742671 "eventSourceARN" : "arn:aws:sqs:us-east-1:123456789012:test-queue" ,
26752672 "body" : json .dumps (sns_notification ),
26762673 "messageAttributes" : {},
2674+ "eventSource" : "aws:sqs" ,
26772675 }
26782676 ]
26792677 }
@@ -2701,6 +2699,7 @@ def test_sqs_event_without_datadog_message_attributes(
27012699 {
27022700 "eventSourceARN" : "arn:aws:sqs:us-east-1:123456789012:test-queue" ,
27032701 "messageAttributes" : {},
2702+ "eventSource" : "aws:sqs" ,
27042703 }
27052704 ]
27062705 }
@@ -2732,6 +2731,7 @@ def test_sqs_event_with_malformed_datadog_message_attributes(
27322731 "messageAttributes" : {
27332732 "_datadog" : {"dataType" : "String" , "stringValue" : dd_json_data }
27342733 },
2734+ "eventSource" : "aws:sqs" ,
27352735 }
27362736 ]
27372737 }
@@ -2760,7 +2760,8 @@ def test_sns_event_without_datadog_message_attributes(
27602760 "Sns" : {
27612761 "TopicArn" : "arn:aws:sns:us-east-1:123456789012:test-topic" ,
27622762 "MessageAttributes" : {},
2763- }
2763+ },
2764+ "eventSource" : "aws:sns" ,
27642765 }
27652766 ]
27662767 }
@@ -2793,7 +2794,8 @@ def test_sns_event_with_malformed_datadog_message_attributes(
27932794 "MessageAttributes" : {
27942795 "_datadog" : {"Type" : "String" , "Value" : dd_json_data }
27952796 },
2796- }
2797+ },
2798+ "eventSource" : "aws:sns" ,
27972799 }
27982800 ]
27992801 }
@@ -2834,6 +2836,7 @@ def test_sns_to_sqs_event_with_malformed_datadog_message_attributes(
28342836 "eventSourceARN" : "arn:aws:sqs:us-east-1:123456789012:test-queue" ,
28352837 "body" : json .dumps (sns_notification ),
28362838 "messageAttributes" : {},
2839+ "eventSource" : "aws:sqs" ,
28372840 }
28382841 ]
28392842 }
@@ -2866,7 +2869,7 @@ def test_sqs_sns_event_with_exception_accessing_first_record(
28662869 event , self .lambda_context
28672870 )
28682871
2869- mock_dsm_set_checkpoint .assert_called_once_with ( None , "sns" , "" )
2872+ mock_dsm_set_checkpoint .assert_not_called ( )
28702873 mock_extract_from_lambda_context .assert_called_once_with (self .lambda_context )
28712874 self .assertEqual (result , mock_context )
28722875
@@ -2982,6 +2985,6 @@ def test_kinesis_event_with_exception_accessing_first_record(
29822985
29832986 # Verify that _dsm_set_checkpoint is called with empty string for arn
29842987 # even when exception occurs
2985- mock_dsm_set_checkpoint .assert_called_once_with ( None , "kinesis" , "" )
2988+ mock_dsm_set_checkpoint .assert_not_called ( )
29862989 mock_extract_from_lambda_context .assert_called_once_with (self .lambda_context )
29872990 self .assertEqual (result , mock_context )
0 commit comments