mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +01:00
Improve test coverage
This commit is contained in:
parent
5850ed82e4
commit
4f17bc1b14
@ -15,6 +15,19 @@ func TestWebConfig_SocketAddress(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWebConfig_PrependWithContextRoot(t *testing.T) {
|
||||
web := &webConfig{ContextRoot: "/status/"}
|
||||
if result := web.PrependWithContextRoot("/api/v1/results"); result != "/status/api/v1/results/" {
|
||||
t.Errorf("expected %s, got %s", "/status/api/v1/results/", result)
|
||||
}
|
||||
if result := web.PrependWithContextRoot("/health"); result != "/status/health/" {
|
||||
t.Errorf("expected %s, got %s", "/status/health/", result)
|
||||
}
|
||||
if result := web.PrependWithContextRoot("/health/"); result != "/status/health/" {
|
||||
t.Errorf("expected %s, got %s", "/status/health/", result)
|
||||
}
|
||||
}
|
||||
|
||||
// validContextRootTest specifies all test case which should end up in
|
||||
// a valid context root used to bind the web interface to
|
||||
var validContextRootTests = []struct {
|
||||
|
Loading…
Reference in New Issue
Block a user