Ejemplo n.º 1
0
 def test_calc_pie_sales_group4(self):
     test_name = "Calc Chart Data Test #12"
     data_to_test = 850
     class_to_test = CalcData()
     expected_result = 1
     # Action
     class_to_test.calc_pie_sales(data_to_test)
     result = class_to_test.count_sales_group4
     # 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))
Ejemplo n.º 2
0
 def test_pie_chart_false(self):
     test_name = "Calc Chart Data Pie Chart FALSE Test #08"
     data_to_test = "testing"
     class_to_test = CalcData()
     expected_result = None
     class_to_test.calc_pie_sales(150)
     class_to_test.calc_pie_sales(250)
     # Action
     result = class_to_test.pie_chart(data_to_test)
     # 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))
Ejemplo n.º 3
0
 def test_calc_pie_sales_value_error(self):
     test_name = "Calc Chart Data Test #32"
     data_to_test = 'testing'
     class_to_test = CalcData()
     expected_result = None
     # Action
     result = class_to_test.calc_pie_sales(data_to_test)
     # 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))