def init_session(self, profile=None): if not profile: profile = self.profile f_names = list(self.test_flows.keys()) f_names.sort() self["flow_names"] = [] for k in self.order: k += '-' l = [z for z in f_names if z.startswith(k)] self["flow_names"].extend(l) _tests = [] for k in self["flow_names"]: _test = self.test_flows[k] if map_prof(profile, _test["profile"]): try: kwargs = {"mti": _test["mti"]} except KeyError: kwargs = {} _tests.append(Node(k, _test["desc"], **kwargs)) self["tests"] = _tests self["test_info"] = {} self["profile"] = profile self.session = session return session
def make_list(flows, profile, **kw_args): f_names = flows.keys() f_names.sort() flow_names = [] for k in kw_args["orddesc"]: k += '-' l = [z for z in f_names if z.startswith(k)] flow_names.extend(l) res = [] sprofile = profile.split(".") for tid in flow_names: _flow = flows[tid] if map_prof(sprofile, _flow["profile"].split(".")): res.append(tid) return res
def conditional_execution(oper, arg): for key, val in arg.items(): if key == 'profile': if not map_prof(oper.profile, val): oper.skip = True return