示例#1
0
 def test_addition_integers(self):
     """ Test addition of two integers returns the correct total. """
     result = simple_calc.add(1, 2)
     self.assertEqual(result, 3)
示例#2
0
 def test_adding_on_window(self):
     result = simple_calc.add(1, 2)
     self.assertEqual(result, 3)
示例#3
0
 def test_add_strings(self):
     """ Test addition of two strings returns a concantenated string. """
     result = simple_calc.add('abc', 'def')
     self.assertEqual(result, 'abcdef')
示例#4
0
 def test_addition_floats(self):
     """ Test addition of two floats returns the correct total. """
     result = simple_calc.add(10.5, 2)
     self.assertEqual(result, 12.5)
def test_add():
    assert simple_calc.add(0, 0) == 0
    assert simple_calc.add(-1, -1) == -2
    assert simple_calc.add(4, 5) == 9
    assert simple_calc.add(1, 2, 3, 4, 5) == 15
示例#6
0
 def test_add(self):
     self.assertEqual(simple_calc.add(5, 3), 8)
     self.assertEqual(simple_calc.add(5, -3), 2)
     self.assertEqual(simple_calc.add(-5, -3), -8)