MCPcopy Create free account
hub / github.com/nhost/nhost / TestPostgres

Function TestPostgres

cli/dockercompose/postgres_test.go:74–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

72}
73
74func TestPostgres(t *testing.T) {
75 t.Parallel()
76
77 cases := []struct {
78 name string
79 cfg func() *model.ConfigConfig
80 expected func(tmpdir string) *Service
81 }{
82 {
83 name: "success",
84 cfg: getConfig,
85 expected: expectedPostgres,
86 },
87 }
88
89 for _, tc := range cases {
90 t.Run(tc.name, func(t *testing.T) {
91 t.Parallel()
92
93 tmpdir := filepath.Join(os.TempDir(), "data")
94
95 got, err := postgres(tc.cfg(), "dev", 5432, tmpdir, "pgdate_test")
96 if err != nil {
97 t.Errorf("got error: %v", err)
98 }
99
100 if diff := cmp.Diff(tc.expected(tmpdir), got); diff != "" {
101 t.Error(diff)
102 }
103 })
104 }
105}

Callers

nothing calls this directly

Calls 4

postgresFunction · 0.85
ErrorfMethod · 0.80
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected