mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 16:03:44 +01:00
Improve test coverage
This commit is contained in:
parent
46cf616a57
commit
fb3447eaf3
@ -1,13 +1,19 @@
|
|||||||
package storage
|
package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/TwinProduction/gatus/storage/store/sqlite"
|
"github.com/TwinProduction/gatus/storage/store/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestGet(t *testing.T) {
|
||||||
|
store := Get()
|
||||||
|
if store == nil {
|
||||||
|
t.Error("store should've been automatically initialized")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestInitialize(t *testing.T) {
|
func TestInitialize(t *testing.T) {
|
||||||
type Scenario struct {
|
type Scenario struct {
|
||||||
Name string
|
Name string
|
||||||
@ -62,7 +68,7 @@ func TestInitialize(t *testing.T) {
|
|||||||
t.Error("ctx shouldn't have been nil")
|
t.Error("ctx shouldn't have been nil")
|
||||||
}
|
}
|
||||||
if provider == nil {
|
if provider == nil {
|
||||||
fmt.Println("wtf?")
|
t.Fatal("provider shouldn't have been nit")
|
||||||
}
|
}
|
||||||
provider.Close()
|
provider.Close()
|
||||||
// Try to initialize it again
|
// Try to initialize it again
|
||||||
|
Loading…
Reference in New Issue
Block a user