@@ -50,17 +50,11 @@ def test_basic(
5050 assert span ["name" ] == "aws.s3.ListObjects"
5151
5252
53- @pytest .mark .parametrize ("send_default_pii" , [True , False ])
54- def test_streaming (
55- sentry_init ,
56- capture_events ,
57- capture_items ,
58- send_default_pii ,
59- ):
53+ def test_streaming (sentry_init , capture_events , capture_items ):
6054 sentry_init (
6155 traces_sample_rate = 1.0 ,
6256 integrations = [Boto3Integration ()],
63- send_default_pii = send_default_pii ,
57+ data_collection = {} ,
6458 )
6559
6660 s3 = session .resource ("s3" )
@@ -101,15 +95,11 @@ def test_streaming(
10195 "thread.id" : mock .ANY ,
10296 "thread.name" : mock .ANY ,
10397 }
104- if send_default_pii :
105- expected_attrs ["url.full" ] = "https://bucket.s3.amazonaws.com/foo.pdf"
98+ expected_attrs ["url.full" ] = "https://bucket.s3.amazonaws.com/foo.pdf"
10699 assert span1 ["attributes" ] == ApproxDict (expected_attrs )
107100
108101 assert "url.fragment" not in span1 ["attributes" ]
109102 assert "url.query" not in span1 ["attributes" ]
110- if not send_default_pii :
111- assert "url.full" not in span1 ["attributes" ]
112-
113103 span2 = spans [1 ]
114104 assert span2 ["attributes" ]["sentry.op" ] == "http.client.stream"
115105 assert span2 ["name" ] == "aws.s3.GetObject"
@@ -157,7 +147,7 @@ def test_omit_url_data_if_parsing_fails(
157147 sentry_init (
158148 traces_sample_rate = 1.0 ,
159149 integrations = [Boto3Integration ()],
160- send_default_pii = True ,
150+ data_collection = {} ,
161151 )
162152
163153 s3 = session .resource ("s3" )
@@ -228,12 +218,11 @@ def test_span_origin(
228218 assert spans [0 ]["attributes" ]["sentry.origin" ] == "auto.http.boto3"
229219
230220
231- @pytest .mark .parametrize ("send_default_pii" , [True , False ])
232- def test_breadcrumb (sentry_init , capture_events , send_default_pii ):
221+ def test_breadcrumb (sentry_init , capture_events ):
233222 sentry_init (
234223 integrations = [Boto3Integration ()],
235224 default_integrations = False ,
236- send_default_pii = send_default_pii ,
225+ data_collection = {} ,
237226 )
238227
239228 s3 = session .resource ("s3" )
@@ -253,24 +242,14 @@ def test_breadcrumb(sentry_init, capture_events, send_default_pii):
253242 assert crumb ["type" ] == "http"
254243 assert crumb ["category" ] == "httplib"
255244
256- if send_default_pii :
257- assert crumb ["data" ] == ApproxDict (
258- {
259- SPANDATA .URL_FULL : mock .ANY ,
260- SPANDATA .HTTP_REQUEST_METHOD : "GET" ,
261- SPANDATA .URL_QUERY : mock .ANY ,
262- }
263- )
264- assert SPANDATA .URL_FRAGMENT not in crumb ["data" ]
265- else :
266- assert crumb ["data" ] == ApproxDict (
267- {
268- SPANDATA .HTTP_REQUEST_METHOD : "GET" ,
269- }
270- )
271- assert SPANDATA .URL_FULL not in crumb ["data" ]
272- assert SPANDATA .URL_QUERY not in crumb ["data" ]
273- assert SPANDATA .URL_FRAGMENT not in crumb ["data" ]
245+ assert crumb ["data" ] == ApproxDict (
246+ {
247+ SPANDATA .URL_FULL : mock .ANY ,
248+ SPANDATA .HTTP_REQUEST_METHOD : "GET" ,
249+ SPANDATA .URL_QUERY : mock .ANY ,
250+ }
251+ )
252+ assert SPANDATA .URL_FRAGMENT not in crumb ["data" ]
274253
275254
276255BUCKET_URL = "https://bucket.s3.amazonaws.com/"
@@ -279,19 +258,9 @@ def test_breadcrumb(sentry_init, capture_events, send_default_pii):
279258# means the URL is recorded without a query string.
280259# Structure of the parameters is "init_kwargs, expected_query"
281260URL_QUERY_PARAMS = [
282- pytest .param (
283- {"send_default_pii" : True },
284- "list-type=2&prefix=foo&continuation-token=abc&encoding-type=url" ,
285- id = "send_default_pii_true" ,
286- ),
287- pytest .param (
288- {"send_default_pii" : False },
289- None ,
290- id = "send_default_pii_false" ,
291- ),
292261 pytest .param (
293262 {},
294- None ,
263+ "list-type=2&prefix=foo&continuation-token=%5BFiltered%5D&encoding-type=url" ,
295264 id = "defaults" ,
296265 ),
297266 pytest .param (
@@ -334,14 +303,6 @@ def test_breadcrumb(sentry_init, capture_events, send_default_pii):
334303 "" ,
335304 id = "data_collection_off" ,
336305 ),
337- pytest .param (
338- {
339- "send_default_pii" : True ,
340- "data_collection" : {"url_query_params" : {"mode" : "off" }},
341- },
342- "" ,
343- id = "data_collection_wins_over_send_default_pii" ,
344- ),
345306]
346307
347308
0 commit comments