Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Reckony committed Oct 30, 2023
1 parent f9570bd commit 43e38de
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions unit_tests/test_03_apouey.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
from src.apouey_index import get_apouey_index
import unittest

responses = [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
]
DS = []
DS.extend(10 * [1])
DS.extend(10 * [2])
DS.extend(10 * [3])
DS.extend(5 * [4])
DS.extend(15 * [5])

INDICATORS = [1, 2, 3, 4, 5]


def test_apouey_positive():
assert get_apouey_index(categories=5, responses=responses) == 0.55
assert round(get_apouey_index(INDICATORS, DS), 3) == 0.673


class ApoueyTestCase(unittest.TestCase):
def test_apouey_negative(self):
with self.assertRaises(AttributeError):
get_apouey_index(categories=1, responses=responses)
get_apouey_index(categories=11, responses=responses)
get_apouey_index(categories=[1], responses=DS)
get_apouey_index(categories=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], responses=DS)

0 comments on commit 43e38de

Please sign in to comment.