(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestInitPostgresqlError(t *testing.T) { |
| 55 | _ = config.Init(configs.Path("serverNameExample.yml")) |
| 56 | |
| 57 | // change config error test |
| 58 | config.Get().Database.Postgresql.Dsn = "root:123456@(127.0.0.1:5432)/test" |
| 59 | |
| 60 | utils.SafeRunWithTimeout(time.Second*2, func(cancel context.CancelFunc) { |
| 61 | _ = CloseDB() |
| 62 | InitPostgresql() |
| 63 | assert.NotNil(t, gdb) |
| 64 | cancel() |
| 65 | }) |
| 66 | } |
| 67 | |
| 68 | func TestInitSqliteError(t *testing.T) { |
| 69 | _ = config.Init(configs.Path("serverNameExample.yml")) |
nothing calls this directly
no test coverage detected