MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / TestCertFile

Function TestCertFile

internal/pgbackrest/certificates_test.go:23–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21func (f funcMarshaler) MarshalText() ([]byte, error) { return f() }
22
23func TestCertFile(t *testing.T) {
24 expected := errors.New("boom")
25 var short funcMarshaler = func() ([]byte, error) { return []byte(`one`), nil }
26 var fail funcMarshaler = func() ([]byte, error) { return nil, expected }
27
28 text, err := certFile(short, short, short)
29 assert.NilError(t, err)
30 assert.DeepEqual(t, text, []byte(`oneoneone`))
31
32 text, err = certFile(short, fail, short)
33 assert.Equal(t, err, expected)
34 assert.DeepEqual(t, text, []byte(nil))
35}
36
37func TestClientCommonName(t *testing.T) {
38 t.Parallel()

Callers

nothing calls this directly

Calls 2

certFileFunction · 0.70
EqualMethod · 0.45

Tested by

no test coverage detected