test(web/api/status): 100% LOC
continuous-integration/drone the build failed Details

This commit is contained in:
Geno 2021-06-23 13:39:57 +02:00
parent 679191c55b
commit 83ad1cf65f
1 changed files with 10 additions and 1 deletions

View File

@ -15,9 +15,18 @@ func TestAPIStatus(t *testing.T) {
assert.NotNil(s) assert.NotNil(s)
obj := Status{} obj := Status{}
// GET - common name // GET
s.Request(http.MethodGet, "/api/status", nil, http.StatusOK, &obj) s.Request(http.MethodGet, "/api/status", nil, http.StatusOK, &obj)
assert.Equal(VERSION, obj.Version) assert.Equal(VERSION, obj.Version)
assert.Equal(EXTRAS, obj.Extras) assert.Equal(EXTRAS, obj.Extras)
assert.True(obj.Up) assert.True(obj.Up)
UP = func() bool { return false }
obj = Status{}
// GET - failed status
s.Request(http.MethodGet, "/api/status", nil, http.StatusInternalServerError, &obj)
assert.Equal(VERSION, obj.Version)
assert.Equal(EXTRAS, obj.Extras)
assert.False(obj.Up)
} }