Skip to content

Commit

Permalink
[druid] Minor style cleanup in tests file.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwolfe committed Jul 27, 2017
1 parent 03be3cf commit 96cfbfe
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/druid_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ def test_sync_druid_perm(self, PyDruid):
assert pv is not None

def test_metrics_and_post_aggs(self):
"""
Test generation of metrics and post-aggregations from an initial list
of superset metrics (which may include the results of either). This
primarily tests that specifying a post-aggregator metric will also
require the raw aggregation of the associated druid metric column.
"""
metrics_dict = {
'unused_count': DruidMetric(
metric_name='unused_count',
Expand Down Expand Up @@ -363,22 +369,22 @@ def test_metrics_and_post_aggs(self):

metrics = ['some_sum']
all_metrics, post_aggs = DruidDatasource._metrics_and_post_aggs(
metrics, metrics_dict)
metrics, metrics_dict)

assert all_metrics == ['some_sum']
assert post_aggs == {}

metrics = ['quantile_p95']
all_metrics, post_aggs = DruidDatasource._metrics_and_post_aggs(
metrics, metrics_dict)
metrics, metrics_dict)

result_postaggs = set(['quantile_p95'])
assert all_metrics == ['a_histogram']
assert set(post_aggs.keys()) == result_postaggs

metrics = ['aCustomPostAgg']
all_metrics, post_aggs = DruidDatasource._metrics_and_post_aggs(
metrics, metrics_dict)
metrics, metrics_dict)

result_postaggs = set(['aCustomPostAgg'])
assert all_metrics == ['aCustomMetric']
Expand Down

0 comments on commit 96cfbfe

Please sign in to comment.