import sys
import os
import pytest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../app')))
from redis_config import setup_redis

@pytest.fixture
def app():
    from flask import Flask
    from config import Config
    app = Flask(__name__)
    app.config.from_object(Config)
    return app

def test_setup_redis(app):
    with app.app_context():
        redis_connection = setup_redis(app)
        assert redis_connection is not None
        assert redis_connection.ping() is True
