def test_mean_na_neutral_vote_maps_na_votes(self): """Test that mean_na_neutral_vote() maps N/A votes to neutral.""" self.assertEqual(mean_na_neutral_vote([Eval.not_applicable]), Eval.neutral.value) self.assertEqual( mean_na_neutral_vote([Eval.not_applicable, Eval.very_inconsistent]), Eval.inconsistent.value)
def test_mean_na_neutral_vote_only_maps_na_votes(self): """Test that mean_na_neutral_vote() does not map values other than N/A.""" for x in Eval: if x is not Eval.not_applicable: self.assertEqual(mean_na_neutral_vote([x]), x.value)