MCPcopy
hub / github.com/dosco/graphjin / TestIntrospection

Function TestIntrospection

tests/intro_test.go:46–64  ·  view source on GitHub ↗

go:embed test-db.ddl var testSchema []byte func TestIntrospection1(t *testing.T) { ds, err := qcode.ParseSchema(testSchema) if err != nil { t.Fatal(err) } dbinfo := sdata.NewDBInfo(ds.Type, ds.Version, ds.Schema, "", ds.Columns, ds.Functions, nil) aliases := map[string][]string{

(t *testing.T)

Source from the content-addressed store, hash-verified

44// }
45
46func TestIntrospection(t *testing.T) {
47
48 dir, err := os.MkdirTemp("", "test")
49 if err != nil {
50 panic(err)
51 }
52 defer os.RemoveAll(dir) //nolint:errcheck
53 fs := core.NewOsFS(dir)
54
55 conf := newConfig(&core.Config{DBType: dbType, EnableIntrospection: true})
56 gj, err := core.NewGraphJin(conf, db, core.OptionSetFS(fs))
57 if err != nil {
58 panic(err)
59 }
60 defer gj.Close()
61 b, err := fs.Get("intro.json")
62 assert.NoError(t, err)
63 assert.NotEmpty(t, b)
64}

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.95
newConfigFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected