def test_aggregate(self): md = {} with self.assertRaises(ModelError): measure = create_measure_aggregate(md) measure = create_measure_aggregate("amount_sum") self.assertIsInstance(measure, MeasureAggregate) self.assertEqual("amount_sum", measure.name)
def test_fact_count(self): md = {"name": "count", "function": "count"} agg = create_measure_aggregate(md) self.assertEqual("count", agg.name) self.assertIsNone(agg.measure) self.assertEqual("count", agg.function) self.assertIsNone(agg.formula)