def test_basdai_complete_when_all_answers_valid(self) -> None: basdai = Basdai() basdai.q1 = 0 basdai.q2 = 0 basdai.q3 = 0 basdai.q4 = 0 basdai.q5 = 0 basdai.q6 = 0 self.assertTrue(basdai.is_complete())
def test_basdai_incomplete_when_a_field_invalid(self) -> None: basdai = Basdai() basdai.q1 = 11 basdai.q2 = 0 basdai.q3 = 0 basdai.q4 = 0 basdai.q5 = 0 basdai.q6 = 0 self.assertFalse(basdai.is_complete())
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)