Exemplo n.º 1
0
    def _test_node_success(self, node: Node, ntype):
        mgr = rvt.make_actions_for(node)
        a1 = mgr.next_action()
        assert isinstance(a1, list), msg('list', a1)
        assert a1[0] == ntype, msg(ntype, a1[0])

        mgr.on_success(a1)
        assert rvt.is_built(node) is True, msg(True, rvt.is_built(node))

        for i in range(node.nsucs):
            a2 = mgr.next_action()
            assert a2[0] == _Cmd_pipe, msg(_Cmd_pipe, a2[0])
            assert a2[2] == _Pipe_CnPt, msg(_Pipe_CnPt, a2[2])
            mgr.on_success(a2)

        for e in node.successors(edges=True):
            self._edge_stat(e, True, True, not True)
Exemplo n.º 2
0
    def _test_node_fail(self, node: Node, ntype):
        mgr = rvt.make_actions_for(node)
        a1 = mgr.next_action()
        assert isinstance(a1, list), msg('list', a1)
        assert a1[0] == ntype, msg(ntype, a1[0])

        mgr.on_fail(a1)
        assert rvt.is_built(node) is False, msg(False, rvt.is_built(node))

        for i in range(node.nsucs):
            a2 = mgr.next_action()
            assert a2[0] == _Cmd_pipe, msg(_Cmd_pipe, a2[0])
            assert a2[2] == _Pipe_PtPt, msg(_Pipe_PtPt, a2[2])
            mgr.on_success(a2)

        for e in node.successors(edges=True):
            b, c1, c2 = _edge_status(e)
            assert b is True, msg(True, b)
            assert c1 is not True, msg(False, c1)
            assert c2 is not True, msg(False, c2)