MCPcopy Index your code
hub / github.com/upper/db / TestQueryLogger

Method TestQueryLogger

internal/testsuite/sql_suite.go:199–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197}
198
199func (s *SQLTestSuite) TestQueryLogger() {
200 logLevel := db.LC().Level()
201
202 db.LC().SetLogger(logrus.New())
203 db.LC().SetLevel(db.LogLevelDebug)
204
205 defer func() {
206 db.LC().SetLogger(nil)
207 db.LC().SetLevel(logLevel)
208 }()
209
210 sess := s.Session()
211
212 _, err := sess.Collection("artist").Find().Count()
213 s.Equal(nil, err)
214
215 _, err = sess.Collection("artist_x").Find().Count()
216 s.NotEqual(nil, err)
217}
218
219func (s *SQLTestSuite) TestExpectCursorError() {
220 sess := s.Session()

Callers

nothing calls this directly

Calls 8

LevelMethod · 0.65
SetLoggerMethod · 0.65
NewMethod · 0.65
SetLevelMethod · 0.65
SessionMethod · 0.65
CountMethod · 0.65
FindMethod · 0.65
CollectionMethod · 0.65

Tested by

no test coverage detected