createMockPoolConnection creates a mock pool connection for testing
()
| 37 | |
| 38 | // createMockPoolConnection creates a mock pool connection for testing |
| 39 | func createMockPoolConnection() *pool.Conn { |
| 40 | mockNetConn := &mockNetConn{addr: "test:6379"} |
| 41 | conn := pool.NewConn(mockNetConn) |
| 42 | conn.SetUsable(true) // Make connection usable for testing (transitions to IDLE) |
| 43 | // Simulate real flow: connection is acquired (IDLE → IN_USE) before OnPut is called |
| 44 | conn.SetUsed(true) // Transition to IN_USE state |
| 45 | return conn |
| 46 | } |
| 47 | |
| 48 | // mockPool implements pool.Pooler for testing |
| 49 | type mockPool struct { |
no test coverage detected