X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5562d6d556a942b66ea392c1e9bc803f9b9733e7..7c430b8a41da3a66522d1ca08e3a9f637b609195:/services/keepstore/status_test.go?ds=sidebyside diff --git a/services/keepstore/status_test.go b/services/keepstore/status_test.go index 134b016625..7bff2584e5 100644 --- a/services/keepstore/status_test.go +++ b/services/keepstore/status_test.go @@ -1,11 +1,21 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main import ( "encoding/json" ) -func getStatusItem(keys ...string) interface{} { - resp := IssueRequest(&RequestTester{"/status.json", "", "GET", nil}) +// We don't have isolated unit tests for /status.json yet, but we do +// check (e.g., in pull_worker_test.go) that /status.json reports +// specific statistics correctly at the appropriate times. + +// getStatusItem("foo","bar","baz") retrieves /status.json, decodes +// the response body into resp, and returns resp["foo"]["bar"]["baz"]. +func getStatusItem(h *handler, keys ...string) interface{} { + resp := IssueRequest(h, &RequestTester{"/status.json", "", "GET", nil}) var s interface{} json.NewDecoder(resp.Body).Decode(&s) for _, k := range keys {