Skip to content

Commit bd85842

Browse files
committed
Fixed TestDoGetFallback test
Signed-off-by: Joe Elliott <[email protected]>
1 parent 393adc9 commit bd85842

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

api/prometheus/v1/api_test.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -1268,12 +1268,16 @@ func TestDoGetFallback(t *testing.T) {
12681268
// Start a local HTTP server.
12691269
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
12701270
req.ParseForm()
1271-
r := &testResponse{
1271+
testResp, _ := json.Marshal(&testResponse{
12721272
Values: req.Form.Encode(),
12731273
Method: req.Method,
1274+
})
1275+
1276+
apiResp := &apiResponse{
1277+
Data: testResp,
12741278
}
12751279

1276-
body, _ := json.Marshal(r)
1280+
body, _ := json.Marshal(apiResp)
12771281

12781282
if req.Method == http.MethodPost {
12791283
if req.URL.Path == "/blockPost" {

0 commit comments

Comments
 (0)