(t *testing.T)
| 307 | } |
| 308 | |
| 309 | func TestUpdatePermission(t *testing.T) { |
| 310 | Convey("test UpdatePermission to a address", t, func() { |
| 311 | var stopTestService func() |
| 312 | var err error |
| 313 | var user, chain proto.AccountAddress |
| 314 | var perm types.UserPermission |
| 315 | |
| 316 | // driver not initialized |
| 317 | _, err = UpdatePermission(user, chain, &perm) |
| 318 | So(err, ShouldEqual, ErrNotInitialized) |
| 319 | |
| 320 | // fake driver initialized |
| 321 | atomic.StoreUint32(&driverInitialized, 1) |
| 322 | _, err = UpdatePermission(user, chain, &perm) |
| 323 | So(err, ShouldNotBeNil) |
| 324 | // reset driver not initialized |
| 325 | atomic.StoreUint32(&driverInitialized, 0) |
| 326 | |
| 327 | stopTestService, _, err = startTestService() |
| 328 | So(err, ShouldBeNil) |
| 329 | defer stopTestService() |
| 330 | |
| 331 | // with mock bp, any params will be success |
| 332 | _, err = UpdatePermission(user, chain, &perm) |
| 333 | So(err, ShouldBeNil) |
| 334 | }) |
| 335 | } |
| 336 | |
| 337 | func TestRunPeerListUpdater(t *testing.T) { |
| 338 | Convey("test peersUpdaterRunning", t, func() { |
nothing calls this directly
no test coverage detected