Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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)