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

Function TestInit

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

Source from the content-addressed store, hash-verified

37)
38
39func TestInit(t *testing.T) {
40 log.SetLevel(log.DebugLevel)
41 // test init
42 Convey("test init", t, func() {
43 var stopTestService func()
44 var confDir string
45 var err error
46
47 stopTestService, confDir, err = startTestService()
48 log.Debugf("config dir: %s", confDir)
49 So(err, ShouldBeNil)
50 defer stopTestService()
51
52 // already init ed
53 err = Init(filepath.Join(confDir, "config.yaml"), []byte(""))
54 So(err, ShouldNotBeNil)
55
56 // fake driver not initialized
57 atomic.StoreUint32(&driverInitialized, 0)
58 err = Init(filepath.Join(confDir, "config.yaml"), []byte(""))
59 So(err, ShouldBeNil)
60
61 // test loaded block producer nodes
62 bps := route.GetBPs()
63 So(len(bps), ShouldBeGreaterThanOrEqualTo, 1)
64 //So(bps[0].ToRawNodeID().ToNodeID(), ShouldResemble, (*conf.GConf.KnownNodes)[0].ID)
65
66 stopPeersUpdater()
67 })
68}
69
70func TestDefaultInit(t *testing.T) {
71 log.SetLevel(log.DebugLevel)

Callers

nothing calls this directly

Calls 6

SetLevelFunction · 0.92
DebugfFunction · 0.92
GetBPsFunction · 0.92
startTestServiceFunction · 0.85
InitFunction · 0.85
stopPeersUpdaterFunction · 0.85

Tested by

no test coverage detected