Beispiel #1
0
import calculus

my_sum = calculus.add(2, 7)
print(my_sum)
Beispiel #2
0
def test_addition():
    assert add(2, 3) == 5
Beispiel #3
0
 def test_add(self):
     self.assertEqual(c.add(1, 2), 3)
Beispiel #4
0
def test_addition_additive_identity(a):
    assert add(a, 0) == a == add(0, a)
Beispiel #5
0
def test_addition_associativity(a, b, c):
    assert add(a, add(b, c)) == add(add(a, b), c)
Beispiel #6
0
def test_addition_commutativity(a, b):
    assert add(a, b) == add(b, a)
Beispiel #7
0
def test_addition_parametrized(test_input, expected):
    [a, b] = test_input
    assert add(a, b) == expected
 def test_add(self):
     self.assertEqual(c.add(1, 3), 4)
     self.assertEqual(c.add(2, 3), 5)
     self.assertEqual(c.add(-3, 3), 0)