MCPcopy Create free account
hub / github.com/araddon/qlbridge / TestJsonDataSource

Function TestJsonDataSource

datasource/json_test.go:39–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestJsonDataSource(t *testing.T) {
40 jsonIn, err := jsonStringSource.Open("user.json")
41 assert.Equal(t, nil, err, "should not have error: %v", err)
42 iter, ok := jsonIn.(schema.ConnScanner)
43 assert.True(t, ok)
44 iterCt := 0
45 for msg := iter.Next(); msg != nil; msg = iter.Next() {
46 iterCt++
47 u.Infof("row: %v", msg.Body())
48 }
49 assert.Equal(t, 3, iterCt, "should have 3 rows: %v", iterCt)
50}

Callers

nothing calls this directly

Calls 4

OpenMethod · 0.65
EqualMethod · 0.65
NextMethod · 0.65
BodyMethod · 0.65

Tested by

no test coverage detected