예제 #1
0
 def test_predict_3(self):
     test_window = MainWindow()
     test_window.w1 = 2
     test_window.w2 = 2.5
     test_window.w3 = 1.45
     test_window.w4 = 3.62
     test_window.b = 5.6
     max_temp = 30
     min_temp = 25.5
     rainfall = -3.4
     solar = 20
     result = ValueError
     self.assertEqual(
         test_window.predict(max_temp, min_temp, rainfall, solar), result)
예제 #2
0
 def test_predict_4(self):
     test_window = MainWindow()
     test_window.w1 = 2
     test_window.w2 = 2.5
     test_window.w3 = 1.45
     test_window.w4 = 3.62
     test_window.b = 5.6
     max_temp = 'Thirty'
     min_temp = 'twenty five point five'
     rainfall = 'Three Point four'
     solar = 'twenty'
     result = TypeError
     self.assertEqual(
         test_window.predict(max_temp, min_temp, rainfall, solar), result)
예제 #3
0
 def test_predict_2(self):
     test_window = MainWindow()
     test_window.w1 = 2
     test_window.w2 = -2.5
     test_window.w3 = 1.45
     test_window.w4 = -3.62
     test_window.b = 5.6
     max_temp = 30
     min_temp = 25.5
     rainfall = 3.4
     solar = 20
     result = -1.00006562
     self.assertEqual(
         test_window.predict(max_temp, min_temp, rainfall, solar), result)