MCPcopy
hub / github.com/puma/puma-dev / generateLivePumaDevCertIfNotExist

Function generateLivePumaDevCertIfNotExist

cmd/puma-dev/main_test.go:130–142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

128}
129
130func generateLivePumaDevCertIfNotExist(t *testing.T) {
131 liveSupportPath := homedir.MustExpand(dev.SupportDir)
132 liveCertPath := filepath.Join(liveSupportPath, "cert.pem")
133 liveKeyPath := filepath.Join(liveSupportPath, "key.pem")
134
135 if !FileExists(liveCertPath) || !FileExists(liveKeyPath) {
136 MakeDirectoryOrFail(t, liveSupportPath)
137
138 if err := dev.GeneratePumaDevCertificateAuthority(liveCertPath, liveKeyPath); err != nil {
139 assert.FailNow(t, err.Error())
140 }
141 }
142}
143
144func getURLWithHost(t *testing.T, url string, host string) string {
145 req, _ := http.NewRequest("GET", url, nil)

Callers 1

Calls 4

MustExpandFunction · 0.92
FileExistsFunction · 0.85
MakeDirectoryOrFailFunction · 0.85

Tested by

no test coverage detected