@@ -492,37 +492,36 @@ def test_customize_logs_exporter_sigv4(self):
492492 _customize_logs_exporter (OTLPGrpcLogExporter (), Resource .get_empty ()), OTLPGrpcLogExporter
493493 )
494494
495- # def test_init_logging(self):
496- # captured_exporter = None
497-
498- # def capture_exporter(*args, **kwargs):
499- # nonlocal captured_exporter
500- # result = _customize_logs_exporter(*args, **kwargs)
501- # captured_exporter = result
502- # return result
503-
504- # test_cases = [
505- # [{"otlp": OTLPLogExporter}, OTLPLogExporter],
506- # [{}, OTLPLogExporter],
507- # [{"grpc": OTLPGrpcLogExporter}, OTLPGrpcLogExporter],
508- # ]
495+ def test_init_logging (self ):
496+ captured_exporter = None
497+
498+ def capture_exporter (* args , ** kwargs ):
499+ nonlocal captured_exporter
500+ result = _customize_logs_exporter (* args , ** kwargs )
501+ captured_exporter = result
502+ return result
503+
504+ test_cases = [
505+ [{"otlp" : OTLPLogExporter }, OTLPLogExporter ],
506+ [{}, OTLPLogExporter ],
507+ ]
509508
510- # os.environ[OTEL_EXPORTER_OTLP_LOGS_ENDPOINT] = "https://logs.us-east-1.amazonaws.com/v1/logs"
509+ os .environ [OTEL_EXPORTER_OTLP_LOGS_ENDPOINT ] = "https://logs.us-east-1.amazonaws.com/v1/logs"
511510
512- # with patch(
513- # "amazon.opentelemetry.distro.aws_opentelemetry_configurator._customize_logs_exporter"
514- # ) as mock_customize_logs_exporter:
511+ with patch (
512+ "amazon.opentelemetry.distro.aws_opentelemetry_configurator._customize_logs_exporter"
513+ ) as mock_customize_logs_exporter :
515514
516- # mock_customize_logs_exporter.side_effect = capture_exporter
515+ mock_customize_logs_exporter .side_effect = capture_exporter
517516
518- # for tc in test_cases:
519- # exporter_dict = tc[0]
520- # expected_exporter = tc[1]
521- # _init_logging(exporter_dict, Resource.get_empty())
517+ for tc in test_cases :
518+ exporter_dict = tc [0 ]
519+ expected_exporter = tc [1 ]
520+ _init_logging (exporter_dict , Resource .get_empty ())
522521
523- # self.assertIsInstance(captured_exporter, expected_exporter)
522+ self .assertIsInstance (captured_exporter , expected_exporter )
524523
525- # os.environ.pop(OTEL_EXPORTER_OTLP_LOGS_ENDPOINT)
524+ os .environ .pop (OTEL_EXPORTER_OTLP_LOGS_ENDPOINT )
526525
527526 def test_customize_span_processors (self ):
528527 mock_tracer_provider : TracerProvider = MagicMock ()
0 commit comments