Exemple #1
0
def lib_reg_fake_open_test():
    lr = LibRegistry()
    lib = lr.open_fake_lib('fake.library')
    assert lib is not None
    # double open fails
    with pytest.raises(VamosInternalError):
        lib = lr.open_fake_lib('fake.library')
    assert lr.has_open_libs()
    assert lr.get_open_libs() == [lib]
    lr.close_lib('fake.library')
    # double close fails
    with pytest.raises(VamosInternalError):
        lib = lr.close_lib('fake.library')
    assert not lr.has_open_libs()
    assert lr.get_open_libs() == []
Exemple #2
0
def lib_reg_open_all_test():
    lr = LibRegistry()
    all_names = lr.get_all_names()
    for name in all_names:
        lr.open_lib(name)
        lr.close_lib(name)