From 4f09b5b5e82a9244b2c43e29b98e375e1e1b82e1 Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Mon, 4 Mar 2019 18:11:00 +0100 Subject: [PATCH] Remove Redis testing mocks --- redis_test.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/redis_test.go b/redis_test.go index 2a699b04..00c5787c 100644 --- a/redis_test.go +++ b/redis_test.go @@ -3,52 +3,12 @@ package icingadb_connection import ( "github.com/go-redis/redis" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "sync" "sync/atomic" "testing" "time" ) -type RdbMock struct { - mock.Mock -} - -func (m *RdbMock) Ping() *redis.StatusCmd { - args := m.Called() - return args.Get(0).(*redis.StatusCmd) -} - -func (m *RdbMock) Publish(channel string, message interface{}) *redis.IntCmd { - args := m.Called(channel, message) - return args.Get(0).(*redis.IntCmd) -} - -func (m *RdbMock) XRead(a *redis.XReadArgs) *redis.XStreamSliceCmd { - args := m.Called(a) - return args.Get(0).(*redis.XStreamSliceCmd) -} - -func (m *RdbMock) XDel(stream string, ids ...string) *redis.IntCmd { - args := m.Called(stream, ids) - return args.Get(0).(*redis.IntCmd) -} - -func (m *RdbMock) HGetAll(key string) *redis.StringStringMapCmd { - args := m.Called(key) - return args.Get(0).(*redis.StringStringMapCmd) -} - -func (m *RdbMock) TxPipelined(fn func(redis.Pipeliner) error) ([]redis.Cmder, error) { - args := m.Called(fn) - return args.Get(0).([]redis.Cmder), args.Error(1) -} - -func (m *RdbMock) Subscribe(channels ...string) *redis.PubSub { - args := m.Called(channels) - return args.Get(0).(*redis.PubSub) -} - func NewTestRDBW(rdb RedisClient) RDBWrapper { dbw := RDBWrapper{Rdb: rdb, ConnectedAtomic: new(uint32), ConnectionLostCounterAtomic: new(uint32)} dbw.ConnectionUpCondition = sync.NewCond(&sync.Mutex{})