def test_apply_classifiers_adds_correct_columns(): classifier_names = ["a", "b", "c"] classifiers = [_DummyClassifier(x) for x in classifier_names] tpms = _get_test_tpms() t.apply_classifiers(tpms, classifiers) for name in classifier_names: assert tpms[name] is not None
def test_apply_classifiers_calculates_correct_values(): name = "dummy" val = 5 classifiers = [_DummyClassifier(name, lambda x: x[t.CALCULATED_TPM] + val)] tpms = _get_test_tpms() t.apply_classifiers(tpms, classifiers) for index, row in tpms.iterrows(): assert row[name] == CALC_TPMS_VALS[index] + val