tagger/data/data_test.go

29 lines
565 B
Go
Raw Normal View History

2024-04-04 20:30:41 +00:00
package data
import (
"testing"
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/assert"
)
func TestNewDataSource(t *testing.T) {
ds := NewSource()
if ds == nil {
t.Errorf("Failed creating new data source")
}
}
func TestDataSourceOpen(t *testing.T) {
ds := NewSource()
assert.Equal(t, ds.Open(), nil)
}
type MockConnection struct {}
func (m *MockConnection) LRange(context.Context, string, int64, int64) (*redis.StringSliceCmd) { return }
func TestDataSourceGet(t *testing.T) {
ds := NewSource()
ds.Use(&MockConnection{})
}