(t *testing.T, recorder *httptest.ResponseRecorder)
| 124 | } |
| 125 | |
| 126 | func decodeListModelsResponse(t *testing.T, recorder *httptest.ResponseRecorder) map[string]struct{} { |
| 127 | t.Helper() |
| 128 | |
| 129 | require.Equal(t, http.StatusOK, recorder.Code) |
| 130 | var payload listModelsResponse |
| 131 | require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &payload)) |
| 132 | require.True(t, payload.Success) |
| 133 | require.Equal(t, "list", payload.Object) |
| 134 | |
| 135 | ids := make(map[string]struct{}, len(payload.Data)) |
| 136 | for _, item := range payload.Data { |
| 137 | ids[item.Id] = struct{}{} |
| 138 | } |
| 139 | return ids |
| 140 | } |
| 141 | |
| 142 | func pricingByModelName(pricings []model.Pricing) map[string]model.Pricing { |
| 143 | byName := make(map[string]model.Pricing, len(pricings)) |
no test coverage detected