

def test_session_attach():
    (server, session, transport, conn) = _get_test_environment(a=[10])
    eq_(conn.is_open, True)
    eq_(transport.request.arguments, {
        'a': [10],
    })
    eq_(conn.request.get_argument('a'), 10)
    transport.recv(proto.message(None, 'abc'))
    eq_(conn.pop_incoming(), 'abc')
    eq_(transport.pop_outgoing(), '3:::abc')
    conn.close()
    eq_(transport.pop_outgoing(), '0::')
    session.remove_handler(transport)
    eq_(session.handler, None)
    eq_(transport.is_open, False)
    eq_(conn.is_open, False)
    eq_(session.is_closed, True)

dataset/ETHPy150Open mrjoes/tornadio2/tests/session_test.py test_session_attach/VarMisuse@39/46 `conn`->`transport`