示例#1
0
 def test_add5(self):
     test_param = 10
     result = main.add5(test_param)
     self.assertEqual(result, 15)
示例#2
0
 def test_add5_2(self):
     test_param = "hello"
     result = main.add5(test_param)
     self.assertIsInstance(result, ValueError)
示例#3
0
 def test_add5_5(self):
     test_param = ''
     result = main.add5(test_param)
     self.assertEqual(result, 'please enter a number')
示例#4
0
 def test_add5_6(self):
     test_param = 0
     result = main.add5(test_param)
     self.assertEqual(result, 5)
示例#5
0
 def test_add5_3(self):
     test_param = 'sadfva'
     result = main.add5(test_param)
     self.assertIsInstance(result, ValueError)