<commit_before>"""
ACCESS MISSOURI STATS LIBRARY - EFFECTIVENESS UNIT TESTS

"""

import unittest

from amstats import effectiveness


class EffectivenessTests(unittest.TestCase):
    def setUp(self):
        self.leg_zero = {
            "bills_introduced": 0,
            "actions_committee": 0,
            "beyond_committee": 0,
            "bills_passed": 0,
            "bills_law": 0
        }

        self.cohort_zero = {
            "bills_introduced": 0,
            "actions_committee": 0,
            "beyond_committee": 0,
            "bills_passed": 0,
            "bills_law": 0,
            "total": 0
        }

    def test_value_error_none_type(self):
        with self.assertRaises(ValueError):
            effectiveness.calculate_effectiveness(None, None)

    def test_value_error_no_cohort(self):
        with self.assertRaises(ValueError):
            effectiveness.calculate_effectiveness(self.leg_zero, self.cohort_zero)<commit_msg>Added test for more value errors.<commit_after>"""
ACCESS MISSOURI STATS LIBRARY - EFFECTIVENESS UNIT TESTS

"""

import unittest

from amstats import effectiveness


class EffectivenessTests(unittest.TestCase):
    def setUp(self):
        self.leg_zero = {
            "bills_introduced": 0,
            "actions_committee": 0,
            "beyond_committee": 0,
            "bills_passed": 0,
            "bills_law": 0
        }

        self.cohort_zero = {
            "bills_introduced": 0,
            "actions_committee": 0,
            "beyond_committee": 0,
            "bills_passed": 0,
            "bills_law": 0,
            "total": 0
        }

    def test_value_error_none_type(self):
        with self.assertRaises(ValueError):
            effectiveness.calculate_effectiveness(None, None)

    def test_value_error_none_cohort(self):
        with self.assertRaises(ValueError):
            effectiveness.calculate_effectiveness(self.leg_zero, None)

    def test_value_error_no_cohort(self):
        with self.assertRaises(ValueError):
            effectiveness.calculate_effectiveness(self.leg_zero, self.cohort_zero)
{'fraction_non_alphanumeric': 0.09294566253574833, 'fraction_numerical': 0.010486177311725452, 'mean_word_length': 2.3264659270998416, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2846256', 'n_tokens_mistral': 686, 'n_tokens_neox': 617, 'n_words': 118}