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

Function getExportFileList

worker/export_test.go:161–183  ·  view source on GitHub ↗
(t *testing.T, bdir string)

Source from the content-addressed store, hash-verified

159}
160
161func getExportFileList(t *testing.T, bdir string) (dataFiles, schemaFiles, gqlSchema []string) {
162 searchDir := bdir
163 err := filepath.Walk(searchDir, func(path string, f os.FileInfo, err error) error {
164 if f.IsDir() {
165 return nil
166 }
167 if path != bdir {
168 switch {
169 case strings.Contains(path, "gql_schema"):
170 gqlSchema = append(gqlSchema, path)
171 case strings.Contains(path, "schema"):
172 schemaFiles = append(schemaFiles, path)
173 default:
174 dataFiles = append(dataFiles, path)
175 }
176 }
177 return nil
178 })
179 require.NoError(t, err)
180 require.Equal(t, 1, len(dataFiles), "filelist=%v", dataFiles)
181
182 return
183}
184
185func checkExportSchema(t *testing.T, schemaFileList []string) {
186 require.Equal(t, 1, len(schemaFileList))

Callers 2

TestExportRdfFunction · 0.85
TestExportJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected