tests: API: Let nil expected response mean skip check

When we want to check just the json encoding.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2024-04-28 20:03:51 +01:00
parent 5a339ba359
commit c8aed6b0ec
1 changed files with 3 additions and 1 deletions

View File

@ -2892,7 +2892,9 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E
if test.zeroFunc != nil {
test.zeroFunc(res.data)
}
assertAPIResponse(t, res.data, test.response)
if test.response != nil {
assertAPIResponse(t, res.data, test.response)
}
}
if test.responseAsJSON != "" {