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

Method TestGetNonExistentRow_Issue426

adapter/mongo/mongo_test.go:270–290  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

268}
269
270func (s *AdapterTests) TestGetNonExistentRow_Issue426() {
271 // Opening database.
272 sess, err := Open(settings)
273 s.Require().NoError(err)
274
275 defer sess.Close()
276
277 artist := sess.Collection("artist")
278
279 var one artistType
280 err = artist.Find(db.Cond{"name": "nothing"}).One(&one)
281
282 s.NotZero(err)
283 s.Equal(db.ErrNoMoreRows, err)
284
285 var all []artistType
286 err = artist.Find(db.Cond{"name": "nothing"}).All(&all)
287
288 s.Zero(len(all), "All should return an empty slice")
289 s.Equal(0, len(all))
290}
291
292func (s *AdapterTests) TestResultCount() {
293 var err error

Callers

nothing calls this directly

Calls 6

OpenFunction · 0.70
CloseMethod · 0.65
CollectionMethod · 0.65
OneMethod · 0.65
FindMethod · 0.65
AllMethod · 0.65

Tested by

no test coverage detected