diff options
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r-- | api4/apitestlib.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go index bb5ee1594..d77438e04 100644 --- a/api4/apitestlib.go +++ b/api4/apitestlib.go @@ -422,6 +422,21 @@ func CheckBadRequestStatus(t *testing.T, resp *model.Response) { } } +func CheckNotImplementedStatus(t *testing.T, resp *model.Response) { + if resp.Error == nil { + debug.PrintStack() + t.Fatal("should have errored with status:" + strconv.Itoa(http.StatusNotImplemented)) + return + } + + if resp.StatusCode != http.StatusNotImplemented { + debug.PrintStack() + t.Log("actual: " + strconv.Itoa(resp.StatusCode)) + t.Log("expected: " + strconv.Itoa(http.StatusNotImplemented)) + t.Fatal("wrong status code") + } +} + func CheckErrorMessage(t *testing.T, resp *model.Response, errorId string) { if resp.Error == nil { debug.PrintStack() |