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)
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)
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)
def test_sum(): assert sum(1, 2) == 3
def test_sum(self): a = 1 b = 3 result = app.sum(a, b) assert result == 4
def test_sum(): assert sum(5, 3) == 8, 'assert 8'
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 '
def test_sum(self): self.assertEqual(sum([1, 2, 3]), 6, "should be 6")
def test_bad_type(self): data = "banana" with self.assertRaises(TypeError): sum(data)
def test_sum_tuple(self): self.assertEqual(sum((1, 2, 3)), 6, "should be 6")
def test_sum(self): self.assertEqual(app.sum(1, 2), 3)
def test_sum_mala(self): self.assertNotEqual(app.sum(1, 2), 2)