mirror of
https://github.com/vee1e/kubeedge.git
synced 2026-09-01 10:18:33 +00:00
cloud/cloudhub: fix "Node founded" typo in checknode response
checknode.go returned "Node founded" on the success path instead of "Node found". This user-visible string was grammatically wrong. The existing test expected "Node found" but passed silently because assert.Contains does a substring match — "Node found" is a substring of "Node founded" — hiding the bug from CI. Fix: - Correct the response string to "Node found" - Strengthen the test assertion to assert.Equal so any future mismatch will be caught immediately Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
This commit is contained in:
parent
1a3f39fdd2
commit
0ad2059aaf
2 changed files with 2 additions and 2 deletions
|
|
@ -59,7 +59,7 @@ func CheckNode(request *restful.Request, response *restful.Response) {
|
|||
}
|
||||
|
||||
// node exists return success
|
||||
err = response.WriteErrorString(http.StatusOK, "Node founded")
|
||||
err = response.WriteErrorString(http.StatusOK, "Node found")
|
||||
if err != nil {
|
||||
klog.Errorf("failed to send the task resp to edge , err: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ func TestCheckNode(t *testing.T) {
|
|||
container.ServeHTTP(httpWriter, httpReq)
|
||||
|
||||
assert.Equal(t, tt.expectedStatus, httpWriter.Code)
|
||||
assert.Contains(t, httpWriter.Body.String(), tt.expectedBody)
|
||||
assert.Equal(t, tt.expectedBody, httpWriter.Body.String())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue