(t *testing.T)
| 245 | } |
| 246 | |
| 247 | func 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 | |
| 278 | func TestTransferToken(t *testing.T) { |
| 279 | Convey("test TransferToken to a address", t, func() { |
nothing calls this directly
no test coverage detected