Exemplo n.º 1
0
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()))
Exemplo n.º 2
0
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()))
Exemplo n.º 3
0
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)))
Exemplo n.º 4
0
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)))
Exemplo n.º 5
0
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)))
Exemplo n.º 6
0
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)))