Exemple #1
0
 def test_compose_should_return_same_value(self):
     self.assertEqual(compose(lambda x: x)('z4r4tu5str4'), 'z4r4tu5str4')
Exemple #2
0
    def test_compose_verifying_the_execution_order(self):
        foo = lambda x: x * x
        bar = lambda x: x + 42

        self.assertEqual(compose(foo, bar)(7), foo(bar(7)))
Exemple #3
0
    def test_compose_should_return_a_callable(self):
        composed_functions = compose(lambda x: x, lambda y: y)

        self.assertTrue(hasattr(composed_functions, '__call__'))