mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
test(api): add autospec to MagicMock-based patch usage (#32752)
This commit is contained in:
@ -360,7 +360,7 @@ class TestEndToEndCacheFlow:
|
||||
class TestRedisFailover:
|
||||
"""Test behavior when Redis is unavailable."""
|
||||
|
||||
@patch("services.api_token_service.redis_client")
|
||||
@patch("services.api_token_service.redis_client", autospec=True)
|
||||
def test_graceful_degradation_when_redis_fails(self, mock_redis):
|
||||
"""Test system degrades gracefully when Redis is unavailable."""
|
||||
from redis import RedisError
|
||||
|
||||
Reference in New Issue
Block a user