def test_get_stats_returns_correct_number_of_statistics(): num_statistics = 5 statistics = [_DummyStatistic(str(i), False) for i in range(num_statistics)] tpms = _get_test_tpms() tp_tpms = _get_test_tp_tpms() stats = t.get_stats(tpms, tp_tpms, statistics) assert len(stats.columns) == num_statistics
def test_get_stats_calculates_correct_values(): name1 = "dummy1" name2 = "dummy2" statistics = [_DummyStatistic(name1, False), _DummyStatistic(name2, True)] tpms = _get_test_tpms() tp_tpms = _get_test_tp_tpms() stats = t.get_stats(tpms, tp_tpms, statistics) assert stats[name1].ix[0] == len(tpms) assert stats[name2].ix[0] == len(tp_tpms)
def test_get_stats_returns_correct_column_names(): name1 = "dummy1" name2 = "dummy2" statistics = [_DummyStatistic(name1, False), _DummyStatistic(name2, False)] tpms = _get_test_tpms() tp_tpms = _get_test_tp_tpms() stats = t.get_stats(tpms, tp_tpms, statistics) assert name1 in stats.columns assert name2 in stats.columns
def test_get_stats_returns_correct_number_of_statistics(): num_statistics = 5 statistics = [ _DummyStatistic(str(i), False) for i in range(num_statistics) ] tpms = _get_test_tpms() tp_tpms = _get_test_tp_tpms() stats = t.get_stats(tpms, tp_tpms, statistics) assert len(stats.columns) == num_statistics