libkv_test.go 449 B

123456789101112131415161718192021222324
  1. package libkv
  2. import (
  3. "testing"
  4. "time"
  5. "github.com/docker/libkv/store"
  6. "github.com/stretchr/testify/assert"
  7. )
  8. func TestNewStoreUnsupported(t *testing.T) {
  9. client := "localhost:9999"
  10. kv, err := NewStore(
  11. "unsupported",
  12. []string{client},
  13. &store.Config{
  14. ConnectionTimeout: 10 * time.Second,
  15. },
  16. )
  17. assert.Error(t, err)
  18. assert.Nil(t, kv)
  19. assert.Equal(t, "Backend storage not supported yet, please choose one of ", err.Error())
  20. }