MCPcopy
hub / github.com/dgraph-io/dgraph / TestProcessTask

Function TestProcessTask

worker/worker_test.go:174–204  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

172}
173
174func TestProcessTask(t *testing.T) {
175 dg := initClusterTest(t, `neighbour: [uid] .`)
176
177 resp, err := runQuery(dg, "neighbour", []uint64{10, 11, 12}, nil)
178 require.NoError(t, err)
179 require.JSONEq(t, `{
180 "q": [
181 {
182 "neighbour": [
183 { "uid": "0x17" },
184 { "uid": "0x1f" }
185 ]
186 },
187 {
188 "neighbour": [
189 { "uid": "0x17" }
190 ]
191 },
192 {
193 "neighbour": [
194 { "uid": "0x17" },
195 { "uid": "0x19" },
196 { "uid": "0x1a" },
197 { "uid": "0x1f" }
198 ]
199 }
200 ]
201 }`,
202 string(resp.Json),
203 )
204}
205
206func runQuery(dg *dgo.Dgraph, attr string, uids []uint64, srcFunc []string) (*api.Response, error) {
207 x.AssertTrue(uids == nil || srcFunc == nil)

Callers

nothing calls this directly

Calls 2

initClusterTestFunction · 0.85
runQueryFunction · 0.70

Tested by

no test coverage detected