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

Function checkExportGqlSchema

worker/export_test.go:210–225  ·  view source on GitHub ↗
(t *testing.T, gqlSchemaFiles []string)

Source from the content-addressed store, hash-verified

208}
209
210func checkExportGqlSchema(t *testing.T, gqlSchemaFiles []string) {
211 require.Equal(t, 1, len(gqlSchemaFiles))
212 file := gqlSchemaFiles[0]
213 f, err := os.Open(file)
214 require.NoError(t, err)
215
216 r, err := gzip.NewReader(f)
217 require.NoError(t, err)
218 var buf bytes.Buffer
219 _, err = buf.ReadFrom(r)
220 require.NoError(t, err)
221 expected := []x.ExportedGQLSchema{{Namespace: x.RootNamespace, Schema: gqlSchema}}
222 b, err := json.Marshal(expected)
223 require.NoError(t, err)
224 require.JSONEq(t, string(b), buf.String())
225}
226
227func TestExportRdf(t *testing.T) {
228 // Index the name predicate. We ensure it doesn't show up on export.

Callers 2

TestExportRdfFunction · 0.85
TestExportJsonFunction · 0.85

Calls 2

OpenMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected