示例#1
0
def test_decorator():
    r = Registry("")

    @r.add
    def bar():
        pass

    r.get("bar")
示例#2
0
def test_add_module():
    r = Registry("")

    r.add_from_module(module)

    r.get("foo")

    with pytest.raises(RegistryException):
        r.get_instance("bar")
示例#3
0
def test_kwargs():
    r = Registry("")

    r.add(bar=foo)

    r.get("bar")