Beispiel #1
0
    def test_mutator(msg):
        nonlocal _mut_active
        if _mut_active:
            _mut_active = False

            return (pchain(echo_plan(num=2, command=cmd2), single_message_gen(msg)), bad_tail())
        return None, None
Beispiel #2
0
    def test_mutator(msg):
        nonlocal _mut_active
        if _mut_active:
            _mut_active = False

            return (pchain(echo_plan(num=2, command=cmd2),
                           single_message_gen(msg)), bad_tail())
        return None, None
Beispiel #3
0
    def test_mutator(msg):
        nonlocal _mut_active
        if _mut_active:
            _mut_active = False

            return (pchain(echo_plan(num=pre_count, command=pre_cmd),
                           single_message_gen(msg)),
                    echo_plan(num=post_count, command=post_cmd))
        return None, None
    def test_mutator(msg):
        nonlocal _mut_active
        if _mut_active:
            _mut_active = False

            return (pchain(echo_plan(num=pre_count, command=pre_cmd),
                            single_message_gen(msg)),
                    echo_plan(num=post_count, command=post_cmd))
        return None, None
Beispiel #5
0
def test_finialize_success():
    suc_cmd = "it_works"

    num = 5
    cmd = "echo"
    plan = finalize_wrapper(single_message_gen(Msg(suc_cmd, None)), echo_plan(command=cmd, num=num))
    msgs = list()
    try:
        EchoRE(plan, msg_list=msgs)
    except RuntimeError:
        pass

    total = num + 1
    _verify_msg_seq(msgs, m_len=total, cmd_sq=[suc_cmd] + [cmd] * num, args_sq=[()] * total, kwargs_sq=[{}] * total)
Beispiel #6
0
def test_finialize_success():
    suc_cmd = 'it_works'

    num = 5
    cmd = 'echo'
    plan = finalize_wrapper(single_message_gen(Msg(suc_cmd, None)),
                            echo_plan(command=cmd, num=num))

    msgs = list()
    try:
        EchoRE(plan, msg_list=msgs)
    except RuntimeError:
        pass

    total = num + 1
    _verify_msg_seq(msgs,
                    m_len=total,
                    cmd_sq=[suc_cmd] + [cmd] * num,
                    args_sq=[()] * total,
                    kwargs_sq=[{}] * total)
Beispiel #7
0
 def test_mutator(msg):
     if msg.command == 'bar':
         return (failing_plan(), single_message_gen(Msg('foo')))
     return None, None