Ejemplo n.º 1
0
def test_load_module():
    class DummyModule(modules.BaseModule):
        pass

    manager = Manager()

    manager.load_module(DummyModule)
    assert manager.get_wrapper(DummyModule) is not None

    manager.unload_module(DummyModule)
    assert manager.get_wrapper(DummyModule) is None
Ejemplo n.º 2
0
def test_load_twice():
    class DummyModule(modules.BaseModule):
        pass

    manager = Manager()

    manager.load_module(DummyModule)
    assert manager.get_wrapper(DummyModule) is not None
    assert len(manager.module_wrappers) == 1

    manager.load_module(DummyModule)
    assert manager.get_wrapper(DummyModule) is not None
    assert len(manager.module_wrappers) == 1