

def _get_test_environment(conn=None, **kwargs):
    request = DummyRequest(**kwargs)
    server = DummyServer((conn or DummyConnection))
    session = server.create_session(request)
    transport = DummyTransport(session, request)
    conn = session.conn
    session.set_handler(transport)
    eq_(session.handler, transport)
    session.flush()
    eq_(transport.pop_outgoing(), '1::')
    return (server, session, transport, conn)

dataset/ETHPy150Open mrjoes/tornadio2/tests/session_test.py _get_test_environment/original