MCPcopy
hub / github.com/jackc/pgx / TestConnectConfig

Function TestConnectConfig

pgxpool/pool_test.go:31–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestConnectConfig(t *testing.T) {
32 t.Parallel()
33 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
34 defer cancel()
35 connString := os.Getenv("PGX_TEST_DATABASE")
36 config, err := pgxpool.ParseConfig(connString)
37 require.NoError(t, err)
38 pool, err := pgxpool.NewWithConfig(ctx, config)
39 require.NoError(t, err)
40 assertConfigsEqual(t, config, pool.Config(), "Pool.Config() returns original config")
41 pool.Close()
42}
43
44func TestParseConfigExtractsPoolArguments(t *testing.T) {
45 t.Parallel()

Callers

nothing calls this directly

Calls 5

ParseConfigFunction · 0.92
NewWithConfigFunction · 0.92
assertConfigsEqualFunction · 0.70
CloseMethod · 0.65
ConfigMethod · 0.45

Tested by

no test coverage detected