def test_resolve_entry_point(): """ Resolving an entry point function works without binding. """ registry = Registry() factory = registry.resolve("hello_world") assert_that(factory, is_(not_none()))
def test_bind_and_resolve(): """ Binding a function allows it be resolved. """ registry = Registry() registry.bind("foo", create_foo) factory = registry.resolve("foo") assert_that(factory, is_(equal_to(create_foo)))
def test_binding(): """ Binding registers function. """ registry = Registry() @binding("foo", registry=registry) def func(*args, **kwargs): pass assert_that(registry.resolve("foo"), is_(equal_to(func)))