(t testing.TB, expected herodot.DefaultError, q *ketoapi.RelationQuery, opts ...paginationOptionSetter)
| 109 | } |
| 110 | |
| 111 | func (rc *restClient) queryTupleErr(t testing.TB, expected herodot.DefaultError, q *ketoapi.RelationQuery, opts ...paginationOptionSetter) { |
| 112 | urlQuery := q.ToURLQuery() |
| 113 | |
| 114 | pagination := getPaginationOptions(opts...) |
| 115 | if pagination.Size != 0 { |
| 116 | urlQuery.Set("page_size", strconv.Itoa(pagination.Size)) |
| 117 | } |
| 118 | if pagination.Token != "" { |
| 119 | urlQuery.Set("page_token", pagination.Token) |
| 120 | } |
| 121 | |
| 122 | body, code := rc.makeRequest(t, http.MethodGet, fmt.Sprintf("%s?%s", relationtuple.ReadRouteBase, urlQuery.Encode()), "", rc.readURL) |
| 123 | |
| 124 | assert.Equal(t, expected.CodeField, code) |
| 125 | assert.Equal(t, int64(expected.StatusCode()), gjson.Get(body, "error.code").Int()) |
| 126 | assert.Equal(t, expected.Status(), gjson.Get(body, "error.status").String()) |
| 127 | assert.Equal(t, expected.Error(), gjson.Get(body, "error.message").String(), body) |
| 128 | } |
| 129 | |
| 130 | func (rc *restClient) check(t testing.TB, r *ketoapi.RelationTuple) bool { |
| 131 | q := r.ToURLQuery() |
nothing calls this directly
no test coverage detected