Beispiel #1
0
 def test_list_fractions(self):
     """
     Test that it can sum a list of fractions
     """
     data = [Fraction(1, 4), Fraction(1, 4), Fraction(2, 4)]
     result = sum(data)
     self.assertEqual(result, 1)
Beispiel #2
0
 def test_list_floats(self):
     """
     Test that it can sum a list of floats
     """
     data = [0.5, 0.4, 0.1]
     result = sum(data)
     self.assertEqual(result, 1)
Beispiel #3
0
 def test_list_int(self):
     """
     Test that it can sum a list of integers
     """
     data = [1, 2, 3]
     result = sum(data)
     self.assertEqual(result, 6)
Beispiel #4
0
def test_sum():
    assert sum(1, 2) == 3
Beispiel #5
0
 def test_sum(self):
     a = 1
     b = 3
     result = app.sum(a, b)
     assert result == 4
Beispiel #6
0
def test_sum():
    assert sum(5, 3) == 8, 'assert 8'
Beispiel #7
0
def test_sum_calculation():
    # Given a :=5, b := 3
    # When it is called
    # Then it should return 8
    assert sum(5, 3) == 8, 'Calculate 5 + 3 '
Beispiel #8
0
 def test_sum(self):
     self.assertEqual(sum([1, 2, 3]), 6, "should be 6")
Beispiel #9
0
 def test_bad_type(self):
     data = "banana"
     with self.assertRaises(TypeError):
         sum(data)
Beispiel #10
0
 def test_sum_tuple(self):
     self.assertEqual(sum((1, 2, 3)), 6, "should be 6")
Beispiel #11
0
 def test_sum(self):
     self.assertEqual(app.sum(1, 2), 3)
Beispiel #12
0
 def test_sum_mala(self):
     self.assertNotEqual(app.sum(1, 2), 2)