@@ -88,7 +88,7 @@ def test_with_incomplete_datadog_trace_headers(self):
88
88
lambda_ctx = get_mock_context ()
89
89
ctx = extract_dd_trace_context (
90
90
{"headers" : {TraceHeader .TRACE_ID : "123" , TraceHeader .PARENT_ID : "321" }},
91
- lambda_ctx
91
+ lambda_ctx ,
92
92
)
93
93
self .assertDictEqual (
94
94
ctx ,
@@ -118,7 +118,7 @@ def test_with_complete_datadog_trace_headers(self):
118
118
TraceHeader .SAMPLING_PRIORITY : "1" ,
119
119
}
120
120
},
121
- lambda_ctx
121
+ lambda_ctx ,
122
122
)
123
123
self .assertDictEqual (
124
124
ctx ,
@@ -157,21 +157,23 @@ def test_with_sqs_distributed_datadog_trace_data(self):
157
157
"ApproximateReceiveCount" : "1" ,
158
158
"SentTimestamp" : "1545082649183" ,
159
159
"SenderId" : "AIDAIENQZJOLO23YVJ4VO" ,
160
- "ApproximateFirstReceiveTimestamp" : "1545082649185"
160
+ "ApproximateFirstReceiveTimestamp" : "1545082649185" ,
161
161
},
162
162
"messageAttributes" : {
163
163
"_datadog" : {
164
- "StringValue" : json .dumps ({
165
- TraceHeader .TRACE_ID : "123" ,
166
- TraceHeader .PARENT_ID : "321" ,
167
- TraceHeader .SAMPLING_PRIORITY : "1" ,
168
- })
164
+ "StringValue" : json .dumps (
165
+ {
166
+ TraceHeader .TRACE_ID : "123" ,
167
+ TraceHeader .PARENT_ID : "321" ,
168
+ TraceHeader .SAMPLING_PRIORITY : "1" ,
169
+ }
170
+ )
169
171
}
170
172
},
171
173
"md5OfBody" : "e4e68fb7bd0e697a0ae8f1bb342846b3" ,
172
174
"eventSource" : "aws:sqs" ,
173
175
"eventSourceARN" : "arn:aws:sqs:us-east-2:123456789012:my-queue" ,
174
- "awsRegion" : "us-east-2"
176
+ "awsRegion" : "us-east-2" ,
175
177
}
176
178
]
177
179
}
@@ -202,19 +204,18 @@ def test_with_sqs_distributed_datadog_trace_data(self):
202
204
)
203
205
204
206
def test_with_client_context_datadog_trace_data (self ):
205
- lambda_ctx = get_mock_context (client_context = {
206
- "custom" : {
207
- "_datadog" : {
208
- TraceHeader .TRACE_ID : "666" ,
209
- TraceHeader .PARENT_ID : "777" ,
210
- TraceHeader .SAMPLING_PRIORITY : "1" ,
207
+ lambda_ctx = get_mock_context (
208
+ client_context = {
209
+ "custom" : {
210
+ "_datadog" : {
211
+ TraceHeader .TRACE_ID : "666" ,
212
+ TraceHeader .PARENT_ID : "777" ,
213
+ TraceHeader .SAMPLING_PRIORITY : "1" ,
214
+ }
211
215
}
212
216
}
213
- })
214
- ctx = extract_dd_trace_context (
215
- { "test" : "foo" },
216
- lambda_ctx
217
217
)
218
+ ctx = extract_dd_trace_context ({}, lambda_ctx )
218
219
self .assertDictEqual (
219
220
ctx ,
220
221
{
@@ -250,7 +251,7 @@ def test_with_complete_datadog_trace_headers_with_mixed_casing(self):
250
251
"X-Datadog-Sampling-Priority" : "1" ,
251
252
}
252
253
},
253
- lambda_ctx
254
+ lambda_ctx ,
254
255
)
255
256
self .assertDictEqual (
256
257
get_dd_trace_context (),
0 commit comments