Skip to content

Commit

Permalink
test: moved preferred_aggregation test to class
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudssource authored and ocelotl committed Feb 13, 2024
1 parent 489b4c5 commit 6b5cf7a
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,22 @@ def test_exponential_explicit_bucket_histogram(self):
ExplicitBucketHistogramAggregation,
)

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
)


def _resource_metrics(
index: int, scope_metrics: List[ScopeMetrics]
Expand Down Expand Up @@ -1006,19 +1022,3 @@ def _number_data_point(value: int) -> NumberDataPoint:
time_unix_nano=1641946016139533244,
value=value,
)

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 6b5cf7a

Please sign in to comment.