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

Function TestPopulateMutationMap

worker/mutation_integration_test.go:21–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestPopulateMutationMap(t *testing.T) {
22 edges := []*pb.DirectedEdge{{
23 Value: []byte("set edge"),
24 Attr: x.AttrInRootNamespace(""),
25 }}
26 schema := []*pb.SchemaUpdate{{
27 Predicate: x.AttrInRootNamespace("name"),
28 }}
29 m := &pb.Mutations{Edges: edges, Schema: schema}
30
31 mutationsMap, err := populateMutationMap(m)
32 require.NoError(t, err)
33 mu := mutationsMap[1]
34 require.NotNil(t, mu)
35 require.NotNil(t, mu.Edges)
36 require.NotNil(t, mu.Schema)
37}
38
39func TestCheckSchema(t *testing.T) {
40 require.NoError(t, posting.DeleteAll())

Callers

nothing calls this directly

Calls 2

AttrInRootNamespaceFunction · 0.92
populateMutationMapFunction · 0.85

Tested by

no test coverage detected