MCPcopy Create free account
hub / github.com/prometheus/prometheus / TestOptionsMethod

Function TestOptionsMethod

web/api/v1/api_test.go:4497–4511  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4495}
4496
4497func TestOptionsMethod(t *testing.T) {
4498 r := route.New()
4499 api := &API{ready: func(f http.HandlerFunc) http.HandlerFunc { return f }}
4500 api.Register(r)
4501
4502 s := httptest.NewServer(r)
4503 defer s.Close()
4504
4505 req, err := http.NewRequest(http.MethodOptions, s.URL+"/any_path", http.NoBody)
4506 require.NoError(t, err, "Error creating OPTIONS request")
4507 client := &http.Client{}
4508 resp, err := client.Do(req)
4509 require.NoError(t, err, "Error executing OPTIONS request")
4510 require.Equal(t, http.StatusNoContent, resp.StatusCode)
4511}
4512
4513func TestTSDBStatus(t *testing.T) {
4514 tsdb := &fakeDB{}

Callers

nothing calls this directly

Calls 2

RegisterMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…