def _get_test_environment(conn=None, **kwargs):
    # Create test environment
    request = DummyRequest(**kwargs)

    server = DummyServer(conn and DummyConnection)
    session = server.create_session(request)
    transport = DummyTransport(session, request)

    conn = session.conn

    # Attach handler and check if it was attached
    session.set_handler(transport)
    eq_(session.handler, transport)

    # Check if connection event was submitted
    session.flush()
    eq_(transport.pop_outgoing(), '1::')

    return server, session, transport, conn
dataset/ETHPy150Open mrjoes/tornadio2/tests/session_test.py/_get_test_environment/operator `or` -> `and`