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

Function TestOpen

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

Source from the content-addressed store, hash-verified

190}
191
192func TestOpen(t *testing.T) {
193 Convey("test Open", t, func() {
194 var cqlDriver covenantSQLDriver
195 var err error
196
197 // dsn invalid
198 _, err = cqlDriver.Open("invalid dsn")
199 So(err, ShouldNotBeNil)
200
201 if !utils.Exist(utils.HomeDirExpand(DefaultConfigFile)) {
202 // not initialized(will run defaultInit once)
203 _, err = cqlDriver.Open("covenantsql://db")
204 log.Errorf("2nd time open %v", err)
205 So(err, ShouldNotBeNil)
206 }
207
208 // reset driver not initialized
209 atomic.StoreUint32(&driverInitialized, 0)
210 })
211}
212
213func TestGetTokenBalance(t *testing.T) {
214 Convey("test get token balance", t, func() {

Callers

nothing calls this directly

Calls 4

OpenMethod · 0.95
ExistFunction · 0.92
HomeDirExpandFunction · 0.92
ErrorfFunction · 0.92

Tested by

no test coverage detected