55from typing import List
66from unittest .mock import MagicMock , patch
77
8- from amazon .opentelemetry .distro .exporter .otlp .aws .logs .aws_batch_log_record_processor import (
8+ from amazon .opentelemetry .distro .exporter .otlp .aws .logs ._aws_cw_otlp_batch_log_record_processor import (
99 AwsCloudWatchOtlpBatchLogRecordProcessor ,
1010 BatchLogExportStrategy ,
1111)
@@ -117,7 +117,7 @@ def test_process_log_data_nested_structure_size_exceeds_max_log_size(self):
117117 def test_process_log_data_primitive (self ):
118118
119119 primitives : List [AnyValue ] = ["test" , b"test" , 1 , 1.2 , True , False , None , "深入 Python" , "café" ]
120- expected_sizes = [4 , 4 , 1 , 3 , 4 , 5 , 0 , 2 * 4 + len (" Python" ), 1 * 4 + len ("caf " )]
120+ expected_sizes = [4 , 4 , 1 , 3 , 4 , 5 , 0 , 2 * 4 + len (" Python" ), 1 * 4 + len ("calf " )]
121121
122122 for index , primitive in enumerate (primitives ):
123123 log = self .generate_test_log_data (log_body = primitive , count = 1 )
@@ -136,11 +136,11 @@ def test_process_log_data_with_cycle(self):
136136 self .assertEqual (actual_size , expected_size )
137137
138138 @patch (
139- "amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .attach" ,
139+ "amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .attach" ,
140140 return_value = MagicMock (),
141141 )
142- @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .detach" )
143- @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .set_value" )
142+ @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .detach" )
143+ @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .set_value" )
144144 def test_export_single_batch_under_size_limit (self , _ , __ , ___ ):
145145 """Tests that export is only called once if a single batch is under the size limit"""
146146 log_count = 10
@@ -163,11 +163,11 @@ def test_export_single_batch_under_size_limit(self, _, __, ___):
163163 self .mock_exporter .export .assert_called_once ()
164164
165165 @patch (
166- "amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .attach" ,
166+ "amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .attach" ,
167167 return_value = MagicMock (),
168168 )
169- @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .detach" )
170- @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .set_value" )
169+ @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .detach" )
170+ @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .set_value" )
171171 def test_export_single_batch_all_logs_over_size_limit (self , _ , __ , ___ ):
172172 """Should make multiple export calls of batch size 1 to export logs of size > 1 MB."""
173173
@@ -188,11 +188,11 @@ def test_export_single_batch_all_logs_over_size_limit(self, _, __, ___):
188188 self .assertEqual (len (batch [0 ]), 1 )
189189
190190 @patch (
191- "amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .attach" ,
191+ "amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .attach" ,
192192 return_value = MagicMock (),
193193 )
194- @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .detach" )
195- @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs.aws_batch_log_record_processor .set_value" )
194+ @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .detach" )
195+ @patch ("amazon.opentelemetry.distro.exporter.otlp.aws.logs._aws_cw_otlp_batch_log_record_processor .set_value" )
196196 def test_export_single_batch_some_logs_over_size_limit (self , _ , __ , ___ ):
197197 """Should make calls to export smaller sub-batch logs"""
198198 large_log_body = "X" * (self .processor ._MAX_LOG_REQUEST_BYTE_SIZE + 1 )
0 commit comments