Skip to content

Commit 5a225fa

Browse files
committed
checkstyle fix
1 parent 95f3a65 commit 5a225fa

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_metric_attributes_span_exporter.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727

2828
class TestAwsMetricAttributesSpanExporter(TestCase):
29-
3029
def setUp(self):
3130
self.delegate_mock: SpanExporter = MagicMock()
3231
self.generator_mock: _AwsMetricAttributeGenerator = MagicMock()
@@ -44,7 +43,7 @@ def test_export_delegation_without_attributes_or_modification(self):
4443
span_attributes: Attributes = _build_span_attributes(_CONTAINS_NO_ATTRIBUTES)
4544
span_data_mock: ReadableSpan = _build_readable_span_mock(span_attributes)
4645
metric_attributes: Attributes = _build_metric_attributes(_CONTAINS_NO_ATTRIBUTES)
47-
self.__configure_mock_for_export(span_data_mock, metric_attributes)
46+
self._configure_mock_for_export(span_data_mock, metric_attributes)
4847

4948
self.aws_metric_attributes_span_exporter.export([span_data_mock])
5049
self.delegate_mock.assert_has_calls([call.export([span_data_mock])])
@@ -57,7 +56,7 @@ def test_export_delegation_with_attributes_but_without_modification(self):
5756
span_attributes: Attributes = _build_span_attributes(_CONTAINS_ATTRIBUTES)
5857
span_data_mock: ReadableSpan = _build_readable_span_mock(span_attributes)
5958
metric_attributes: Attributes = _build_metric_attributes(_CONTAINS_NO_ATTRIBUTES)
60-
self.__configure_mock_for_export(span_data_mock, metric_attributes)
59+
self._configure_mock_for_export(span_data_mock, metric_attributes)
6160

6261
self.aws_metric_attributes_span_exporter.export([span_data_mock])
6362
self.delegate_mock.assert_has_calls([call.export([span_data_mock])])
@@ -70,7 +69,7 @@ def test_export_delegation_without_attributes_but_with_modification(self):
7069
span_attributes: Attributes = _build_span_attributes(_CONTAINS_NO_ATTRIBUTES)
7170
span_data_mock: ReadableSpan = _build_readable_span_mock(span_attributes)
7271
metric_attributes: Attributes = _build_metric_attributes(_CONTAINS_ATTRIBUTES)
73-
self.__configure_mock_for_export(span_data_mock, metric_attributes)
72+
self._configure_mock_for_export(span_data_mock, metric_attributes)
7473

7574
self.aws_metric_attributes_span_exporter.export([span_data_mock])
7675
self.delegate_mock.assert_has_calls([call.export([span_data_mock])])
@@ -86,7 +85,7 @@ def test_export_delegation_with_attributes_and_modification(self):
8685
span_attributes: Attributes = _build_span_attributes(_CONTAINS_ATTRIBUTES)
8786
span_data_mock: ReadableSpan = _build_readable_span_mock(span_attributes)
8887
metric_attributes: Attributes = _build_metric_attributes(_CONTAINS_ATTRIBUTES)
89-
self.__configure_mock_for_export(span_data_mock, metric_attributes)
88+
self._configure_mock_for_export(span_data_mock, metric_attributes)
9089

9190
self.aws_metric_attributes_span_exporter.export([span_data_mock])
9291
self.delegate_mock.assert_has_calls([call.export([span_data_mock])])
@@ -109,7 +108,7 @@ def test_export_delegation_with_multiple_spans(self):
109108
span_data_mock3: ReadableSpan = _build_readable_span_mock(_build_span_attributes(_CONTAINS_ATTRIBUTES))
110109
metric_attributes3: Attributes = _build_metric_attributes(_CONTAINS_NO_ATTRIBUTES)
111110

112-
self.__configure_mock_for_export_with_multiple_side_effect(
111+
self._configure_mock_for_export_with_multiple_side_effect(
113112
[span_data_mock1, span_data_mock2, span_data_mock3],
114113
[metric_attributes1, metric_attributes2, metric_attributes3],
115114
)
@@ -141,7 +140,7 @@ def test_overridden_attributes(self):
141140
"key1": "new value1",
142141
"key3": "new value3",
143142
}
144-
self.__configure_mock_for_export(span_data_mock, metric_attributes)
143+
self._configure_mock_for_export(span_data_mock, metric_attributes)
145144

146145
self.aws_metric_attributes_span_exporter.export([span_data_mock])
147146
self.delegate_mock.assert_has_calls([call.export([span_data_mock])])
@@ -156,7 +155,7 @@ def test_export_delegating_span_data_behaviour(self):
156155
span_attributes = _build_span_attributes(_CONTAINS_ATTRIBUTES)
157156
span_data_mock = _build_readable_span_mock_without_deepcopy_support(span_attributes)
158157
metric_attributes = _build_metric_attributes(_CONTAINS_ATTRIBUTES)
159-
self.__configure_mock_for_export(span_data_mock, metric_attributes)
158+
self._configure_mock_for_export(span_data_mock, metric_attributes)
160159

161160
self.aws_metric_attributes_span_exporter.export([span_data_mock])
162161
self.delegate_mock.assert_has_calls([call.export([span_data_mock])])
@@ -311,7 +310,7 @@ def generate_metric_side_effect(span, resource):
311310
for key, value in dependency_metric._dict.items():
312311
self.assertEqual(exported_span._attributes[key], value)
313312

314-
def __configure_mock_for_export(self, span_data_mock: ReadableSpan, metric_attributes: Attributes):
313+
def _configure_mock_for_export(self, span_data_mock: ReadableSpan, metric_attributes: Attributes):
315314
attribute_map: Attributes = {}
316315
if should_generate_service_metric_attributes(span_data_mock):
317316
attribute_map[SERVICE_METRIC] = copy.deepcopy(metric_attributes)
@@ -327,8 +326,8 @@ def generate_metric_attribute_map_side_effect(span, resource):
327326
generate_metric_attribute_map_side_effect
328327
)
329328

330-
def __configure_mock_for_export_with_multiple_side_effect(
331-
self, span_data_mocks: [ReadableSpan], metric_attributes_list: [Attributes]
329+
def _configure_mock_for_export_with_multiple_side_effect(
330+
self, span_data_mocks: [ReadableSpan], metric_attributes_list: [Attributes]
332331
):
333332
attributes_map_list: list = []
334333
for span in span_data_mocks:
@@ -372,7 +371,7 @@ def _build_readable_span_mock(span_attributes: Attributes) -> ReadableSpan:
372371

373372
def _build_readable_span_mock_without_deepcopy_support(span_attributes: Attributes) -> ReadableSpan:
374373
class NoDeepCopyMock(MagicMock):
375-
def __deepcopy__(self, memo):
374+
def _deepcopy_(self, memo):
376375
return self
377376

378377
mock_span_data: ReadableSpan = NoDeepCopyMock()

0 commit comments

Comments
 (0)