tagger/data/data_test.go
Matthew Rich 14fda44c41
Some checks failed
Lint / golangci-lint (push) Failing after 10m25s
Declarative Tests / test (push) Failing after 1m59s
add artifacts
2024-04-04 13:37:54 -07:00

31 lines
649 B
Go

// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
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{})
}