Example #1
0
def test_action_create_one_dofirst():
    action = Action(z1="z1 text").insert(com1={"com1k": "com1v"})
    assert json.dumps(action.wire_dict(), sort_keys=True) == \
           '{"do": [{"com1": {"com1k": "com1v"}}], "z1": "z1 text"}'
Example #2
0
def test_action_create_two_dofirst():
    action = Action(a1="a1 text", z1="z1 text").append(com1={
        "com1k": "com1v"
    }).insert(com2={"com2k": "com2v"})
    assert json.dumps(action.wire_dict(), sort_keys=True) == \
           '{"a1": "a1 text", "do": [{"com2": {"com2k": "com2v"}}, {"com1": {"com1k": "com1v"}}], "z1": "z1 text"}'
Example #3
0
def test_action_create():
    action = Action(frame_name="frame text")
    assert json.dumps(action.wire_dict(), sort_keys=True) == \
           '{"do": [], "frame_name": "frame text"}'