Fix3 the issues with langgenius#9538

Signed-off-by: root <root@localhost.localdomain>
This commit is contained in:
root 2024-10-29 17:21:08 +08:00
parent d66ae4ae12
commit ac817303ce

View File

@ -39,6 +39,11 @@ def lb_model_manager():
return lb_model_manager return lb_model_manager
class FakeRedisClient:
def __init__(self, host='localhost', port=6379, db=0):
self.client = redis.Redis(host=host, port=port, db=db)
def test_lb_model_manager_fetch_next(mocker, lb_model_manager): def test_lb_model_manager_fetch_next(mocker, lb_model_manager):
assert len(lb_model_manager._load_balancing_configs) == 3 assert len(lb_model_manager._load_balancing_configs) == 3
@ -57,7 +62,7 @@ def test_lb_model_manager_fetch_next(mocker, lb_model_manager):
start_index += 1 start_index += 1
return start_index return start_index
fake_redis_client = redis.Redis(host="localhost", port=6379, db=0) fake_redis_client = FakeRedisClient()
redis_client = RedisClientWrapper() redis_client = RedisClientWrapper()
redis_client.initialize(fake_redis_client) redis_client.initialize(fake_redis_client)