Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
rm extra logs
add extra assert for the used schema for json validation
  • Loading branch information
MFTabriz committed Dec 15, 2022
1 parent fd458a4 commit 704cf50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/integration/api_nodeinfo_test.go
Expand Up @@ -27,8 +27,8 @@ func TestNodeinfo(t *testing.T) {
onGiteaRun(t, func(*testing.T, *url.URL) {
req := NewRequestf(t, "GET", "/api/v1/nodeinfo")
resp := MakeRequest(t, req, http.StatusOK)
t.Log("resp.Body.String() 1:", resp.Body.String())
VerifyJSONSchema(t, resp, "nodeinfo_2.1.json")

var nodeinfo api.NodeInfo
DecodeJSON(t, resp, &nodeinfo)
assert.True(t, nodeinfo.OpenRegistrations)
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/integration_test.go
Expand Up @@ -408,10 +408,7 @@ func VerifyJSONSchema(t testing.TB, resp *httptest.ResponseRecorder, schemaFile

schema, schemaFileReadErr := os.ReadFile(schemaFilePath)
assert.Nil(t, schemaFileReadErr)

t.Log("schema:", string(schema))
t.Log("resp.Body.Bytes():", resp.Body.Bytes())
t.Log("resp.Body.String():", resp.Body.String())
assert.True(t, len(schema) > 0)

nodeinfoSchema := gojsonschema.NewStringLoader(string(schema))
nodeinfoString := gojsonschema.NewStringLoader(resp.Body.String())
Expand Down

0 comments on commit 704cf50

Please sign in to comment.