Exemplo n.º 1
0
async def test_init():
    api_key = 'testkey'
    version = '0.0.1'
    ws_endpoint = 'wss://end.point'
    handshake_timeout = 3.21
    return_sub_responses = True
    loop = asyncio.get_event_loop()

    ds = IdexDatastream(
        api_key,
        version,
        ws_endpoint,
        handshake_timeout,
        return_sub_responses,
        loop,
    )

    assert ds._API_KEY == api_key
    assert ds._WS_ENDPOINT == ws_endpoint
    assert ds._WS_VERSION == version
    assert ds._HANDSHAKE_TIMEOUT == handshake_timeout
    assert ds._loop is loop
    assert isinstance(ds._logger, Logger)
    assert isinstance(ds._rid, ShortId)
    assert isinstance(ds.sub_manager, SubscriptionManager)
Exemplo n.º 2
0
async def sm():
    ds = IdexDatastream()
    yield ds.sub_manager
Exemplo n.º 3
0
async def ds():
    ds = IdexDatastream()
    yield ds