MCPcopy Create free account
hub / github.com/brimdata/super / TestQuery

Method TestQuery

service/client_test.go:82–92  ·  view source on GitHub ↗
(query string)

Source from the content-addressed store, hash-verified

80}
81
82func (c *testClient) TestQuery(query string) string {
83 r, err := c.Connection.Query(c.Context(), srcfiles.Plain(query))
84 require.NoError(c, err)
85 defer r.Body.Close()
86 zr := bsupio.NewReader(super.NewContext(), r.Body)
87 defer zr.Close()
88 var buf bytes.Buffer
89 zw := supio.NewWriter(sio.NopCloser(&buf), supio.WriterOpts{})
90 require.NoError(c, sio.Copy(zw, zr))
91 return buf.String()
92}
93
94func (c *testClient) TestLoad(poolID ksuid.KSUID, branchName string, r io.Reader) ksuid.KSUID {
95 commit, err := c.Connection.Load(c.Context(), poolID, branchName, "", r, api.CommitMessage{})

Callers 3

TestQueryFunction · 0.80
TestQueryEmptyPoolFunction · 0.80

Calls 11

CloseMethod · 0.95
PlainFunction · 0.92
NewReaderFunction · 0.92
NewContextFunction · 0.92
NewWriterFunction · 0.92
NopCloserFunction · 0.92
CopyFunction · 0.92
ContextMethod · 0.80
QueryMethod · 0.65
CloseMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected