예제 #1
0
 def test2(self):
     """1230139048019759814598275728974589 +
     59823745982745897298345798237459827345
     """
     a = 1230139048019759814598275728974589
     b = 59823745982745897298345798237459827345
     expected = a + b
     res = sum_(a, b)
     self.assertEqual(res, expected)
예제 #2
0
 def test5(self):
     """2.534 + 1.523 = 4.057"""
     res = sum_(2.534, 1.523)
     self.assertEqual(res, 4.057)
예제 #3
0
 def test4(self):
     """-2 + 2 = 0"""
     res = sum_(-2, 2)
     self.assertEqual(res, 0)
예제 #4
0
 def test3(self):
     """2.5 + 1.5 = 4.0"""
     res = sum_(2.5, 1.5)
     self.assertEqual(res, 4.0)
예제 #5
0
 def test1(self):
     """2 + 2 = 4"""
     res = sum_(2, 2)
     self.assertEqual(res, 4)