def get_scripts(): if os.environ.get("NOC_TEST_SCRIPT"): s_name = os.environ["NOC_TEST_SCRIPT"] return [x for x in loader.iter_scripts() if x == s_name] elif os.environ.get("NOC_TEST_PROFILE"): p_name = "%s." % os.environ["NOC_TEST_PROFILE"] return [x for x in loader.iter_scripts() if x.startswith(p_name)] else: return list(loader.iter_scripts())
def build_script(self): """ Profile names :return: (script name, script name) """ s = set(x.split(".")[-1] for x in script_loader.iter_scripts()) return [{"id": n, "label": n} for n in sorted(s)]
def test_iter_scripts(): assert len(list(loader.iter_scripts())) > 0