Exemplo n.º 1
0
 def test_custom_operators(self):
     iterable = [MockCustomOperators(i) for i in range(1, 5)]
     assert average(iterable, lambda x: x).value == 2.5
Exemplo n.º 2
0
 def test_result(self):
     assert average([1, 2, 3, 4], lambda x: x) == 2.5
     assert average([1, 2, 3, 4], lambda x: x ** 2) == 7.5