def test_backend_registry_find_definitions():
    "creating builders should be as easy as declaring classes"
    assert that(Registry.total()).equals(0)

    class Builder1(Registry):
        name = "First"
        scheme = "builder1://"

    assert that(Registry.total()).equals(1)
    assert that(Registry.get("builder1://")).equals(Builder1)
Ejemplo n.º 2
0
def test_backend_registry_find_definitions():
    "creating builders should be as easy as declaring classes"
    assert that(Registry.total()).equals(0)

    class Builder1(Registry):
        name = 'First'
        scheme = 'builder1://'

    assert that(Registry.total()).equals(1)
    assert that(Registry.get('builder1://')).equals(Builder1)
def test_the_backend_registry_should_be_easy_to_erase():
    u"the backend registry should be easy to erase"

    class Builder2(Registry):
        name = "Second"
        scheme = "builder2://"

    assert Registry.total() >= 1, "there should have one or more builders defined on the registry"

    Registry.clear()

    assert that(Registry.total()).equals(0)
Ejemplo n.º 4
0
def test_the_backend_registry_should_be_easy_to_erase():
    u"the backend registry should be easy to erase"

    class Builder2(Registry):
        name = 'Second'
        scheme = 'builder2://'

    assert Registry.total() >= 1, \
        'there should have one or more builders defined on the registry'

    Registry.clear()

    assert that(Registry.total()).equals(0)