(t *testing.T, out *bytes.Buffer)
| 157 | } |
| 158 | |
| 159 | func decodeDuOutput(t *testing.T, out *bytes.Buffer) duJSONOutput { |
| 160 | t.Helper() |
| 161 | |
| 162 | var got duJSONOutput |
| 163 | if err := json.Unmarshal(out.Bytes(), &got); err != nil { |
| 164 | t.Fatalf("decode JSON output: %v\noutput: %s", err, out.String()) |
| 165 | } |
| 166 | if got.Warnings == nil { |
| 167 | t.Fatalf("warnings = nil, want empty array") |
| 168 | } |
| 169 | if len(got.Warnings) != 0 { |
| 170 | t.Fatalf("warnings = %+v, want empty", got.Warnings) |
| 171 | } |
| 172 | if len(got.Results) != 1 { |
| 173 | t.Fatalf("results len = %d, want 1", len(got.Results)) |
| 174 | } |
| 175 | return got |
| 176 | } |
| 177 | |
| 178 | func individualSpaceUsage() *users.SpaceUsage { |
| 179 | return users.NewSpaceUsage(1024, &users.SpaceAllocation{ |
no outgoing calls
no test coverage detected