mirror of https://github.com/statping/statping
tests
parent
a5c3405940
commit
586c8af931
|
@ -411,7 +411,7 @@ func RunService_Online24(t *testing.T) {
|
|||
service := core.SelectService(1)
|
||||
assert.NotNil(t, service)
|
||||
online := service.OnlineSince(SERVICE_SINCE)
|
||||
assert.Equal(t, float32(80), online)
|
||||
assert.Equal(t, float32(83.33), online)
|
||||
|
||||
service = core.SelectService(6)
|
||||
assert.NotNil(t, service)
|
||||
|
@ -473,7 +473,7 @@ func RunDeleteService(t *testing.T) {
|
|||
func RunCreateService_Hits(t *testing.T) {
|
||||
services := core.CoreApp.Services
|
||||
assert.NotNil(t, services)
|
||||
assert.Equal(t, 19, len(services))
|
||||
assert.Equal(t, 37, len(services))
|
||||
for _, service := range services {
|
||||
service.Check(true)
|
||||
assert.NotNil(t, service)
|
||||
|
@ -528,7 +528,7 @@ func RunPrometheusHandler(t *testing.T) {
|
|||
rr := httptest.NewRecorder()
|
||||
route.ServeHTTP(rr, req)
|
||||
t.Log(rr.Body.String())
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "statup_total_services 19"))
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "statup_total_services 37"))
|
||||
assert.True(t, handlers.IsAuthenticated(req))
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ func TestServiceSum(t *testing.T) {
|
|||
|
||||
func TestCountOnline(t *testing.T) {
|
||||
amount := CoreApp.CountOnline()
|
||||
assert.Equal(t, 2, amount)
|
||||
assert.Equal(t, 4, amount)
|
||||
}
|
||||
|
||||
func TestCreateService(t *testing.T) {
|
||||
|
@ -268,7 +268,7 @@ func TestDeleteService(t *testing.T) {
|
|||
assert.Nil(t, err)
|
||||
|
||||
services := CoreApp.Services
|
||||
assert.Equal(t, 20, len(services))
|
||||
assert.Equal(t, 59, len(services))
|
||||
}
|
||||
|
||||
func TestServiceCloseRoutine(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue