2021-08-06 18:29:01 +02:00
|
|
|
# standard imports
|
|
|
|
|
|
|
|
# external imports
|
|
|
|
import pytest
|
2022-01-03 19:20:27 +01:00
|
|
|
from pytest_redis import factories
|
2021-08-06 18:29:01 +02:00
|
|
|
|
|
|
|
# local imports
|
|
|
|
from cic_ussd.cache import Cache
|
|
|
|
from cic_ussd.session.ussd_session import UssdSession
|
|
|
|
|
2022-01-03 19:20:27 +01:00
|
|
|
redis_test_proc = factories.redis_proc()
|
|
|
|
redis_db = factories.redisdb('redis_test_proc', decode=True)
|
|
|
|
|
2021-08-06 18:29:01 +02:00
|
|
|
|
|
|
|
@pytest.fixture(scope='function')
|
2022-01-03 19:20:27 +01:00
|
|
|
def init_cache(redis_db):
|
|
|
|
Cache.store = redis_db
|
|
|
|
UssdSession.store = redis_db
|
|
|
|
return redis_db
|