Beispiel #1
0
 def test_case3(self):
     result = add(1, '1')  # 程序会抛出error,error表示代码有错误
     self.assertEqual(result, 2)
Beispiel #2
0
 def test_case2(self):
     result = add(1, 1)
     self.assertEqual(result, 3)  # 程序会抛出fail,fail表示断言失败
Beispiel #3
0
 def test_case3(self):
     result = add(2.1, 3.2)
     self.assertEqual(result, 4)
Beispiel #4
0
 def test_case1(self):
     result = add(1, 1)
     self.assertEqual(result, 2)
Beispiel #5
0
 def test_case2(self):
     result = add(2, 3)
     self.assertEqual(result, 4)