MCPcopy
hub / github.com/github/gh-ost / TestGetDBUri

Function TestGetDBUri

go/mysql/connection_test.go:83–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestGetDBUri(t *testing.T) {
84 c := NewConnectionConfig()
85 c.Key = InstanceKey{Hostname: "myhost", Port: 3306}
86 c.User = "gromit"
87 c.Password = "penguin"
88 c.Timeout = 1.2345
89 c.TransactionIsolation = transactionIsolation
90 c.Charset = "utf8mb4,utf8,latin1"
91
92 uri := c.GetDBUri("test")
93 require.Equal(t, `gromit:penguin@tcp(myhost:3306)/test?autocommit=true&interpolateParams=true&charset=utf8mb4,utf8,latin1&tls=false&transaction_isolation="REPEATABLE-READ"&timeout=1.234500s&readTimeout=1.234500s&writeTimeout=1.234500s`, uri)
94}
95
96func TestGetDBUriWithTLSSetup(t *testing.T) {
97 c := NewConnectionConfig()

Callers

nothing calls this directly

Calls 2

GetDBUriMethod · 0.95
NewConnectionConfigFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…