Ejemplo n.º 1
0
    def session_setup(self, session=None, path="", index=0):
        logger.info("session_setup")
        if session is None:
            session = self.session
        _keys = list(session.keys())
        for key in _keys:
            if key.startswith("_"):
                continue
            elif key in [
                    "tests", "flow_names", "response_type", "test_info",
                    "profile"
            ]:  # don't touch !
                continue
            else:
                del session[key]

        session["testid"] = path
        for node in session["tests"]:
            if node.name == path:
                session["node"] = node
                break

        if "node" not in session:
            raise Exception("Unknown node name: {}".format(path))

        session["flow"] = self.test_flows[path]
        session["sequence"] = copy.deepcopy(session["flow"]["sequence"])
        session["sequence"].append(Done)
        session["index"] = index
        self.session = session
Ejemplo n.º 2
0
    def session_setup(self, session=None, path="", index=0):
        logger.info("session_setup")
        if session is None:
            session = self.session
        _keys = list(session.keys())
        for key in _keys:
            if key.startswith("_"):
                continue
            elif key in ["tests", "flow_names", "response_type", "test_info", "profile"]:  # don't touch !
                continue
            else:
                del session[key]

        session["testid"] = path
        for node in session["tests"]:
            if node.name == path:
                session["node"] = node
                break

        if "node" not in session:
            raise Exception("Unknown node name: {}".format(path))

        session["flow"] = self.test_flows[path]
        session["sequence"] = copy.deepcopy(session["flow"]["sequence"])
        session["sequence"].append(Done)
        session["index"] = index
        self.session = session
Ejemplo n.º 3
0
    def reset_session(self, session=None, profile=None):
        if not session:
            session = self.session

        _keys = list(session.keys())
        for key in _keys:
            if key.startswith("_"):
                continue
            else:
                del session[key]
        self.init_session(session, profile)
Ejemplo n.º 4
0
    def reset_session(self, session=None, profile=None):
        if not session:
            session = self.session

        _keys = list(session.keys())
        for key in _keys:
            if key.startswith("_"):
                continue
            else:
                del session[key]
        self.init_session(session, profile)