# Path: sockjs/transports/xhr.py
# class XHRTransport(StreamingTransport):
#     async def process(self):


from aiohttp import web
from sockjs.transports import xhr
import pytest




@pytest.fixture
def make_transport(make_manager, make_request, make_handler, make_fut):
    def maker(method="GET", path="/", query_params={}):
        handler = make_handler(None)
        manager = make_manager(handler)
        request = make_request(method, path, query_params=query_params)
        request.app.freeze()
        session = manager.get("TestSessionXhr", create=True, request=request)
        return xhr.XHRTransport(manager, session, request)

    return maker


async def test_process(make_transport, make_fut):
    transp = make_transport()
    transp.handle_session = make_fut(1)

# Path: sockjs/transports/xhr.py
# class XHRTransport(StreamingTransport):
#     async def process(self):


# Path: tests/test_transport_xhr.py
from aiohttp import web
from sockjs.transports import xhr
import pytest





@pytest.fixture
def make_transport(make_manager, make_request, make_handler, make_fut):
    def maker(method="GET", path="/", query_params={}):
        handler = make_handler(None)
        manager = make_manager(handler)
        request = make_request(method, path, query_params=query_params)
        request.app.freeze()
        session = manager.get("TestSessionXhr", create=True, request=request)
        return xhr.XHRTransport(manager, session, request)

    return maker


async def test_process(make_transport, make_fut):
    transp = make_transport()
    transp.handle_session = make_fut(1)

    resp = await transp.process()