def libmgr_cfg_mgr_custom_test(): lcd = LibCfg(LibCfg.CREATE_MODE_OFF, True, 1, LibCfg.EXPUNGE_MODE_NO_MEM) lmc = LibMgrCfg(do_profile_all=True, profile_add_samples=True, def_cfg=lcd) assert lmc.get_do_profile_all() assert lmc.get_profile_add_samples() assert lmc.get_def_cfg() == lcd assert lmc.get_all_names() == [] assert lmc.get_cfg("bla.library") == lcd lc = LibCfg(LibCfg.CREATE_MODE_OFF, True, 1, LibCfg.EXPUNGE_MODE_NO_MEM) lmc.add_cfg("bla.library", lc) assert lmc.get_cfg("bla.library") == lc assert lmc.get_all_names() == ["bla.library"]
def libmgr_cfg_mgr_default_test(): lmc = LibMgrCfg() assert not lmc.get_do_profile_all() assert not lmc.get_profile_add_samples() assert lmc.get_def_cfg() == LibCfg() assert lmc.get_all_names() == [] assert lmc.get_cfg("bla.library") == LibCfg() lc = LibCfg(LibCfg.CREATE_MODE_OFF, True, 1, LibCfg.EXPUNGE_MODE_NO_MEM) lmc.add_cfg("bla.library", lc) assert lmc.get_cfg("bla.library") == lc assert lmc.get_all_names() == ["bla.library"] assert lmc.get_cfg("foo.library") == LibCfg() lc2 = LibCfg(LibCfg.CREATE_MODE_AMIGA, False, 11, LibCfg.EXPUNGE_MODE_NO_MEM) lmc.add_cfg("foo.library", lc2) assert lmc.get_cfg("foo.library") == lc2 assert lmc.get_all_names() == ["bla.library", "foo.library"]