Пример #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()))
Пример #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()))
Пример #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)))
Пример #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)))
Пример #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)))
Пример #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)))