Пример #1
0
 def test_calc_pie_gender_m(self):
     test_name = "Calc Chart Data Test #6"
     data_to_test = "M"
     class_to_test = CalcData()
     expected_result = 1
     # Action
     class_to_test.calc_pie_gender(data_to_test)
     result = class_to_test.count_gender_m
     # Assert
     try:
         self.assertTrue(result == expected_result)
     except AssertionError:
         print("{} Failed - Should be {}, but was {}.".format(
             test_name, expected_result, result))
     else:
         print("{} Passed".format(test_name))
Пример #2
0
 def test_pie_chart_gender(self):
     test_name = "Calc Chart Data Pie Chart Gender Test #06"
     data_to_test = None
     class_to_test = CalcData()
     expected_result = None
     class_to_test.calc_pie_gender("M")
     class_to_test.calc_pie_gender("F")
     # Action
     result = class_to_test.pie_chart("gender")
     # Assert
     try:
         self.assertTrue(result == expected_result)
     except AssertionError:
         print("{} Failed - Should be {}, but was {}.".format(
             test_name, expected_result, result))
     else:
         print("{} Passed".format(test_name))