mirror of https://github.com/statping/statping
tests
parent
21944e7a94
commit
850a62e81b
|
@ -119,7 +119,7 @@ func TestMainApiRoutes(t *testing.T) {
|
||||||
URL: "/api",
|
URL: "/api",
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
ExpectedContains: []string{`"description":"This data is only used to testing"`},
|
ExpectedContains: []string{`"description":"This is an awesome test"`},
|
||||||
FuncTest: func(t *testing.T) error {
|
FuncTest: func(t *testing.T) error {
|
||||||
if !core.App.Setup {
|
if !core.App.Setup {
|
||||||
return errors.New("database is not setup")
|
return errors.New("database is not setup")
|
||||||
|
|
|
@ -77,7 +77,7 @@ func TestApiServiceRoutes(t *testing.T) {
|
||||||
Name: "Statping Service Failures",
|
Name: "Statping Service Failures",
|
||||||
URL: "/api/services/1/failures",
|
URL: "/api/services/1/failures",
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
ResponseLen: 2,
|
ResponseLen: 125,
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -102,31 +102,31 @@ func TestApiServiceRoutes(t *testing.T) {
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "Statping Service 1 Failure Data - 12 Hour",
|
Name: "Statping Service 1 Failure Data - 24 Hour",
|
||||||
URL: "/api/services/1/failure_data" + startEndQuery + "&group=24h",
|
URL: "/api/services/1/failure_data" + startEndQuery + "&group=24h",
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
ResponseLen: 1,
|
ResponseLen: 4,
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "Statping Service 1 Failure Data - 12 Hour",
|
Name: "Statping Service 1 Failure Data - 12 Hour",
|
||||||
URL: "/api/services/1/failure_data" + startEndQuery + "&group=12h",
|
URL: "/api/services/1/failure_data" + startEndQuery + "&group=12h",
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
ResponseLen: 1,
|
ResponseLen: 7,
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "Statping Service 1 Failure Data - 1 Hour",
|
Name: "Statping Service 1 Failure Data - 1 Hour",
|
||||||
URL: "/api/services/1/failure_data" + startEndQuery + "&group=1h",
|
URL: "/api/services/1/failure_data" + startEndQuery + "&group=1h",
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
ResponseLen: 1,
|
ResponseLen: 72,
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "Statping Service 1 Failure Data - 15 Minute",
|
Name: "Statping Service 1 Failure Data - 15 Minute",
|
||||||
URL: "/api/services/1/failure_data" + startEndQuery + "&group=15m",
|
URL: "/api/services/1/failure_data" + startEndQuery + "&group=15m",
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
ResponseLen: 1,
|
ResponseLen: 124,
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -140,7 +140,7 @@ func TestApiServiceRoutes(t *testing.T) {
|
||||||
Name: "Statping Service 1 Failure Data",
|
Name: "Statping Service 1 Failure Data",
|
||||||
URL: "/api/services/1/failure_data" + startEndQuery,
|
URL: "/api/services/1/failure_data" + startEndQuery,
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
ResponseLen: 1,
|
ResponseLen: 72,
|
||||||
ExpectedStatus: 200,
|
ExpectedStatus: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue