mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-06-04 20:42:58 +00:00
small fix, don't worry about it
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package database
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNewRedisRejectsEmptyURL(t *testing.T) {
|
||||
if _, err := NewRedis(""); err == nil {
|
||||
t.Fatal("expected error for empty redis URL")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewRedisRejectsInvalidURL(t *testing.T) {
|
||||
if _, err := NewRedis("://bad-redis-url"); err == nil {
|
||||
t.Fatal("expected error for invalid redis URL")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewRedisAcceptsValidURL(t *testing.T) {
|
||||
r, err := NewRedis("redis://:password@localhost:6379/0")
|
||||
if err != nil {
|
||||
t.Fatalf("expected valid redis URL, got error: %v", err)
|
||||
}
|
||||
_ = r.Close()
|
||||
}
|
||||
Reference in New Issue
Block a user