Exemplo n.º 1
0
 def test_one_func_with_multiple_args(self):
     func = utils.compose(int)
     assert func('10', base=5) == 5
     assert isinstance(func.funcs, tuple)
     assert func.funcs == (int, )
Exemplo n.º 2
0
 def test_multiple_funcs(self):
     func = utils.compose(str, lambda x: x + 1, int)
     assert isinstance(func.funcs, tuple)
     assert func('30', base=5) == '16'
Exemplo n.º 3
0
 def test_empty(self):
     obj = object()
     func = utils.compose()
     assert func(obj) is obj
     assert isinstance(func.funcs, tuple)
     assert func.funcs == ()