blob: dd42495889388b0afff25cf97dea3084a673244d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// +build all dep
package main
import (
"testing"
)
func TestDatabase(t *testing.T) {
// h := Host{Url: "http://example.com"}
InitDB()
err := Db.DB().Ping()
if err != nil {
//t.Fatal("No database connection established.")
t.Error("No database connection established.")
}
}
func TestRedis(t *testing.T) {
c := pool.Get()
defer c.Close()
if _, err := c.Do("PING"); err != nil {
//t.Fatal("Redis server down.")
t.Error("Down")
}
}
|