def test_basdai_calculation(self) -> None: basdai = Basdai() basdai.q1 = 2 basdai.q2 = 10 basdai.q3 = 7 basdai.q4 = 1 basdai.q5 = 9 basdai.q6 = 3 # 2 + 10 + 7 + 1 = 20 # (9 + 3) / 2 = 6 # 20 + 6 = 26 # 26 / 5 = 5.2 self.assertEqual(basdai.basdai(), 5.2)
def test_basdai_none_when_field_none(self) -> None: basdai = Basdai() self.assertIsNone(basdai.basdai())