1
0
mirror of https://github.com/redis/go-redis.git synced 2025-10-21 20:53:41 +03:00

fix mocks

This commit is contained in:
Nedyalko Dyakov
2025-10-17 13:57:13 +03:00
parent d74671b094
commit 0e10cd7cd2
2 changed files with 15 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ import (
type TestHook struct {
OnGetCalled int
OnPutCalled int
OnRemoveCalled int
GetError error
PutError error
ShouldPool bool
@@ -28,6 +29,10 @@ func (th *TestHook) OnPut(ctx context.Context, conn *Conn) (shouldPool bool, sho
return th.ShouldPool, th.ShouldRemove, th.PutError
}
func (th *TestHook) OnRemove(ctx context.Context, conn *Conn, reason error) {
th.OnRemoveCalled++
}
func TestPoolHookManager(t *testing.T) {
manager := NewPoolHookManager()

View File

@@ -92,6 +92,10 @@ func (mp *mockPool) Stats() *pool.Stats {
return &pool.Stats{}
}
func (mp *mockPool) Size() int {
return 0
}
func (mp *mockPool) AddPoolHook(hook pool.PoolHook) {
// Mock implementation - do nothing
}