(t *testing.T)
| 190 | } |
| 191 | |
| 192 | func 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 | |
| 213 | func TestGetTokenBalance(t *testing.T) { |
| 214 | Convey("test get token balance", t, func() { |
nothing calls this directly
no test coverage detected