Untitled

 avatar
unknown
plain_text
3 years ago
4.2 kB
12
Indexable
➜  asset git:(asset-unit-tests) ✗ pytest
========================================== test session starts ===========================================
platform darwin -- Python 3.9.0, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /Users/shahjalalshohag/alpine/multiplyr-core/backend/test/v2/asset
collected 1 item                                                                                         

test_asset_units.py F                                                                              [100%]

================================================ FAILURES ================================================
____________________________________ test_get_asset_historical_price _____________________________________

    def test_get_asset_historical_price():
>       response = client.get(
            "/getAssetHistoricalPrice", params={"assetTicker": ["BTC"], "period": "all"}
        )

test_asset_units.py:7: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/requests/sessions.py:542: in get
    return self.request('GET', url, **kwargs)
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/starlette/testclient.py:415: in request
    return super().request(
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/requests/sessions.py:529: in request
    resp = self.send(prep, **send_kwargs)
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/requests/sessions.py:645: in send
    r = adapter.send(request, **kwargs)
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/starlette/testclient.py:243: in send
    raise exc from None
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/starlette/testclient.py:240: in send
    loop.run_until_complete(self.app(scope, receive, send))
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:642: in run_until_complete
    return future.result()
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/starlette/routing.py:580: in __call__
    await route.handle(scope, receive, send)
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/starlette/routing.py:241: in handle
    await self.app(scope, receive, send)
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/starlette/routing.py:52: in app
    response = await func(request)
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/fastapi/routing.py:226: in app
    raw_response = await run_endpoint_function(
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/fastapi/routing.py:159: in run_endpoint_function
    return await dependant.call(**values)
../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/fastapi_cache/decorator.py:40: in inner
    backend = FastAPICache.get_backend()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'fastapi_cache.FastAPICache'>

    @classmethod
    def get_backend(cls):
>       assert cls._backend, "You must call init first!"  # nosec: B101
E       AssertionError: You must call init first!

../../../../../../Library/Caches/pypoetry/virtualenvs/backend-w3AgPWHy-py3.9/lib/python3.9/site-packages/fastapi_cache/__init__.py:38: AssertionError
======================================== short test summary info =========================================
FAILED test_asset_units.py::test_get_asset_historical_price - AssertionError: You must call init first!
=========================================== 1 failed in 0.98s ============================================
➜  asset git:(asset-unit-tests) ✗ 
Editor is loading...