Skip to content

Commit 6b5cf7a

Browse files
Dudssourceocelotl
authored andcommitted
test: moved preferred_aggregation test to class
1 parent 489b4c5 commit 6b5cf7a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,22 @@ def test_exponential_explicit_bucket_histogram(self):
968968
ExplicitBucketHistogramAggregation,
969969
)
970970

971+
def test_preferred_aggregation_override(self):
972+
973+
histogram_aggregation = ExplicitBucketHistogramAggregation(
974+
boundaries=[0.05, 0.1, 0.5, 1, 5, 10],
975+
)
976+
977+
exporter = OTLPMetricExporter(
978+
preferred_aggregation={
979+
Histogram: histogram_aggregation,
980+
},
981+
)
982+
983+
self.assertEqual(
984+
exporter._preferred_aggregation[Histogram], histogram_aggregation
985+
)
986+
971987

972988
def _resource_metrics(
973989
index: int, scope_metrics: List[ScopeMetrics]
@@ -1006,19 +1022,3 @@ def _number_data_point(value: int) -> NumberDataPoint:
10061022
time_unix_nano=1641946016139533244,
10071023
value=value,
10081024
)
1009-
1010-
def test_preferred_aggregation_override(self):
1011-
1012-
histogram_aggregation = ExplicitBucketHistogramAggregation(
1013-
boundaries=[0.05, 0.1, 0.5, 1, 5, 10],
1014-
)
1015-
1016-
exporter = OTLPMetricExporter(
1017-
preferred_aggregation={
1018-
Histogram: histogram_aggregation,
1019-
},
1020-
)
1021-
1022-
self.assertEqual(
1023-
exporter._preferred_aggregation[Histogram], histogram_aggregation
1024-
)

0 commit comments

Comments
 (0)