1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
11 // We don't have isolated unit tests for /status.json yet, but we do
12 // check (e.g., in pull_worker_test.go) that /status.json reports
13 // specific statistics correctly at the appropriate times.
15 // getStatusItem("foo","bar","baz") retrieves /status.json, decodes
16 // the response body into resp, and returns resp["foo"]["bar"]["baz"].
17 func getStatusItem(h *handler, keys ...string) interface{} {
18 resp := IssueRequest(h, &RequestTester{"/status.json", "", "GET", nil, ""})
20 json.NewDecoder(resp.Body).Decode(&s)
21 for _, k := range keys {
22 s = s.(map[string]interface{})[k]