MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / TestInitPostgresqlError

Function TestInitPostgresqlError

internal/database/init_test.go:54–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func 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
68func TestInitSqliteError(t *testing.T) {
69 _ = config.Init(configs.Path("serverNameExample.yml"))

Callers

nothing calls this directly

Calls 6

InitFunction · 0.92
PathFunction · 0.92
GetFunction · 0.92
SafeRunWithTimeoutFunction · 0.92
InitPostgresqlFunction · 0.85
CloseDBFunction · 0.70

Tested by

no test coverage detected