def test_assign_function_with_builtin(): chain = Chain( assign_function(dict).to("param"), ) assert_that( chain(), is_(equal_to(dict())), )
def test_assign_function_with_noargs(): chain = Chain( assign_function(lambda: dict()).to("param"), ) assert_that( chain(), is_(equal_to(dict())), )
def test_assign_function_with_context_arg(): def func(context): return "value" chain = Chain(assign_function(func).to("param"), ) assert_that( chain(), is_(equal_to("value")), )
def test_assign_function_with_context_kwarg(): def func(context=None): return "value" chain = Chain( assign_function(func).to("param"), ) assert_that( chain(), is_(equal_to("value")), )