@@ -498,33 +498,33 @@ def test_response_headers(self):
498
498
self .memory_exporter .clear ()
499
499
set_global_response_propagator (orig )
500
500
501
- # def test_credential_removal(self):
502
- # app = HttpServerMock("test_credential_removal")
503
-
504
- # @app.route("/status/200")
505
- # def index():
506
- # return "hello"
507
-
508
- # with app.run("localhost", 5000):
509
- # response = self.fetch(
510
- # "http://username:password@localhost:5000/status/200"
511
- # )
512
- # self.assertEqual(response.code, 200)
513
-
514
- # spans = self.sorted_spans(self.memory_exporter.get_finished_spans())
515
- # self.assertEqual(len(spans), 1)
516
- # client = spans[0]
517
-
518
- # self.assertEqual(client.name, "GET")
519
- # self.assertEqual(client.kind, SpanKind.CLIENT)
520
- # self.assertSpanHasAttributes(
521
- # client,
522
- # {
523
- # SpanAttributes.HTTP_URL: "http://localhost:5000/status/200",
524
- # SpanAttributes.HTTP_METHOD: "GET",
525
- # SpanAttributes.HTTP_STATUS_CODE: 200,
526
- # },
527
- # )
501
+ def test_credential_removal (self ):
502
+ app = HttpServerMock ("test_credential_removal" )
503
+
504
+ @app .route ("/status/200" )
505
+ def index ():
506
+ return "hello"
507
+
508
+ with app .run ("localhost" , 5000 ):
509
+ response = self .fetch (
510
+ "http://username:password@localhost:5000/status/200"
511
+ )
512
+ self .assertEqual (response .code , 200 )
513
+
514
+ spans = self .sorted_spans (self .memory_exporter .get_finished_spans ())
515
+ self .assertEqual (len (spans ), 1 )
516
+ client = spans [0 ]
517
+
518
+ self .assertEqual (client .name , "GET" )
519
+ self .assertEqual (client .kind , SpanKind .CLIENT )
520
+ self .assertSpanHasAttributes (
521
+ client ,
522
+ {
523
+ SpanAttributes .HTTP_URL : "http://localhost:5000/status/200" ,
524
+ SpanAttributes .HTTP_METHOD : "GET" ,
525
+ SpanAttributes .HTTP_STATUS_CODE : 200 ,
526
+ },
527
+ )
528
528
529
529
# self.memory_exporter.clear()
530
530
0 commit comments