mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +01:00
add test
This commit is contained in:
parent
5f10a92c36
commit
c791986143
@ -1,6 +1,9 @@
|
||||
package config
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWebConfig_SocketAddress(t *testing.T) {
|
||||
web := &webConfig{
|
||||
@ -52,6 +55,18 @@ func TestWebConfig_ContextRootInvalid(t *testing.T) {
|
||||
t.Fatal("Should've panicked because the configuration specifies an invalid context root")
|
||||
}
|
||||
|
||||
func TestWebConfig_ContextRootNonParseable(t *testing.T) {
|
||||
defer func() { recover() }()
|
||||
|
||||
web := &webConfig{
|
||||
ContextRoot: "/invalid" + string([]byte{0x7F}) + "/",
|
||||
}
|
||||
|
||||
web.validateAndSetDefaults()
|
||||
|
||||
t.Fatal(fmt.Sprintf("Should've panicked because the configuration specifies an invalid context root %s", web.ContextRoot))
|
||||
}
|
||||
|
||||
func TestWebConfig_ContextRootMultiPath(t *testing.T) {
|
||||
const expected = "/app/status/"
|
||||
web := &webConfig{
|
||||
|
Loading…
Reference in New Issue
Block a user