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

Function TestUpdatePermission

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

Source from the content-addressed store, hash-verified

307}
308
309func 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
337func TestRunPeerListUpdater(t *testing.T) {
338 Convey("test peersUpdaterRunning", t, func() {

Callers

nothing calls this directly

Calls 2

startTestServiceFunction · 0.85
UpdatePermissionFunction · 0.70

Tested by

no test coverage detected