@@ -111,8 +111,8 @@ def Export(self, request, context):
111111
112112
113113class TestOTLPLogExporter (TestCase ):
114- def setUp (self ):
115114
115+ def setUp (self ):
116116 self .exporter = OTLPLogExporter ()
117117
118118 self .server = server (ThreadPoolExecutor (max_workers = 10 ))
@@ -182,26 +182,26 @@ def test_exporting(self):
182182 OTEL_EXPORTER_OTLP_LOGS_ENDPOINT : "logs:4317" ,
183183 OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE : THIS_DIR
184184 + "/fixtures/test.cert" ,
185- OTEL_EXPORTER_OTLP_LOGS_HEADERS : " key1=value1,KEY2 = value =2" ,
185+ OTEL_EXPORTER_OTLP_LOGS_HEADERS : " key1=value1,KEY2 = VALUE =2" ,
186186 OTEL_EXPORTER_OTLP_LOGS_TIMEOUT : "10" ,
187187 OTEL_EXPORTER_OTLP_LOGS_COMPRESSION : "gzip" ,
188188 },
189189 )
190- @ patch (
191- "opentelemetry. exporter.otlp.proto.grpc.exporter.OTLPExporterMixin.__init__"
192- )
193- def test_env_variables ( self , mock_exporter_mixin ):
194- print ( "*************************" )
195- print ( mock_exporter_mixin . call_args_list )
196- self .assertTrue ( len ( mock_exporter_mixin . call_args_list ) == 1 )
197- _ , kwargs = mock_exporter_mixin . call_args_list [ 0 ]
198-
199- self . assertEqual ( kwargs [ "endpoint" ], "log:4317" )
200- self . assertEqual ( kwargs [ "headers" ] , " key1= value1,KEY2 = value=2" )
201- self . assertEqual ( kwargs [ "timeout" ], 10 )
202- self . assertEqual ( kwargs [ "compression" ], Compression . Gzip )
203- self . assertIsNotNone ( kwargs [ "credentials" ])
204- self . assertIsInstance ( kwargs [ "credentials" ], ChannelCredentials )
190+ def test_env_variables ( self ):
191+ exporter = OTLPLogExporter ()
192+ self . assertEqual ( exporter . _endpoint , "logs:4317" )
193+ self . assertEqual ( exporter . _timeout , 10 )
194+ self . assertEqual ( exporter . _compression , Compression . Gzip )
195+ self . assertIsNotNone ( exporter . _credentials )
196+ self .assertIsInstance ( exporter . _credentials , ChannelCredentials )
197+ self . assertEqual (
198+ exporter . _headers ,
199+ (
200+ ( "key1" , "value1" ),
201+ ( "key2" , "VALUE=2" ),
202+ ( "user-agent" , "OTel OTLP Exporter Python/" + __version__ ),
203+ ),
204+ )
205205
206206 @patch (
207207 "opentelemetry.exporter.otlp.proto.grpc.exporter.ssl_channel_credentials"
0 commit comments