예제 #1
0
async def test_start_stop(tdata):
    cp = ClientPlayback()
    with taddons.context(cp) as tctx:
        cp.start_replay([tflow.tflow()])
        assert cp.count() == 1

        cp.start_replay([tflow.twebsocketflow()])
        await tctx.master.await_log("Can only replay HTTP flows.", level="warn")
        assert cp.count() == 1

        cp.stop_replay()
        assert cp.count() == 0
예제 #2
0
async def test_start_stop(tdata):
    cp = ClientPlayback()
    with taddons.context(cp) as tctx:
        cp.start_replay([tflow.tflow(live=False)])
        assert cp.count() == 1

        ws_flow = tflow.twebsocketflow()
        ws_flow.live = False
        cp.start_replay([ws_flow])
        await tctx.master.await_log("Can't replay WebSocket flows.", level="warn")
        assert cp.count() == 1

        cp.stop_replay()
        assert cp.count() == 0