Skip to content

Commit

Permalink
Added unit test to make sure preferred_aggregation override works
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudssource authored and ocelotl committed Feb 13, 2024
1 parent be1cfc1 commit 14af46f
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,19 @@ def test_2xx_status_code(self, mock_otlp_metric_exporter):
OTLPMetricExporter().export(MagicMock()),
MetricExportResult.SUCCESS,
)

def test_preferred_aggregation_override(self):

histogram_aggregation = ExplicitBucketHistogramAggregation(
boundaries=[0.05, 0.1, 0.5, 1, 5, 10],
)

exporter = OTLPMetricExporter(
preferred_aggregation={
Histogram: histogram_aggregation,
},
)

self.assertEqual(
exporter._preferred_aggregation[Histogram], histogram_aggregation
)

0 comments on commit 14af46f

Please sign in to comment.