MCPcopy Create free account
hub / github.com/creativeprojects/resticprofile / TestSetupRemoteConfigurationHTTPError

Function TestSetupRemoteConfigurationHTTPError

remote_test.go:247–258  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

245}
246
247func TestSetupRemoteConfigurationHTTPError(t *testing.T) {
248 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
249 http.Error(w, "internal server error", http.StatusInternalServerError)
250 }))
251 defer srv.Close()
252
253 closeFunc, manifest, err := setupRemoteConfiguration(context.Background(), srv.URL)
254 require.Error(t, err)
255 assert.Nil(t, closeFunc)
256 assert.Nil(t, manifest)
257 assert.Contains(t, err.Error(), "http error 500")
258}
259
260func TestSetupRemoteConfigurationMissingManifest(t *testing.T) {
261 entries := []struct{ name, content string }{

Callers

nothing calls this directly

Calls 3

setupRemoteConfigurationFunction · 0.85
CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected