MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestWaitDBCreation

Function TestWaitDBCreation

client/driver_test.go:247–276  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

245}
246
247func TestWaitDBCreation(t *testing.T) {
248 Convey("test WaitDBCreation", t, func() {
249 var stopTestService func()
250 var err error
251 var dsn string
252
253 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
254 defer cancel()
255
256 err = WaitDBCreation(ctx, "invalid dsn")
257 So(err, ShouldNotBeNil)
258
259 // use default init but failed
260 err = WaitDBCreation(ctx, "covenantsql://db")
261 So(err, ShouldNotBeNil)
262
263 stopTestService, _, err = startTestService()
264 So(err, ShouldBeNil)
265 defer stopTestService()
266 defer stopPeersUpdater()
267
268 err = WaitDBCreation(ctx, "covenantsql://db")
269 So(err, ShouldBeNil)
270
271 _, dsn, err = Create(ResourceMeta{})
272 So(err, ShouldBeNil)
273 err = WaitDBCreation(ctx, dsn)
274 So(err, ShouldNotBeNil)
275 })
276}
277
278func TestTransferToken(t *testing.T) {
279 Convey("test TransferToken to a address", t, func() {

Callers

nothing calls this directly

Calls 4

WaitDBCreationFunction · 0.85
startTestServiceFunction · 0.85
stopPeersUpdaterFunction · 0.85
CreateFunction · 0.70

Tested by

no test coverage detected