Added two tests
This commit is contained in:
parent
93091f7902
commit
bab81734f5
|
@ -194,3 +194,38 @@ func TestHTTP_AllocSnapshot(t *testing.T) {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestHTTP_AllocGC(t *testing.T) {
|
||||
httpTest(t, nil, func(s *TestServer) {
|
||||
// Make the HTTP request
|
||||
req, err := http.NewRequest("GET", "/v1/client/allocation/123/gc", nil)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
respW := httptest.NewRecorder()
|
||||
|
||||
// Make the request
|
||||
_, err = s.Server.ClientAllocRequest(respW, req)
|
||||
if !strings.Contains(err.Error(), "unable to collect allocation") {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestHTTP_AllocAllGC(t *testing.T) {
|
||||
httpTest(t, nil, func(s *TestServer) {
|
||||
// Make the HTTP request
|
||||
req, err := http.NewRequest("GET", "/v1/client/gc", nil)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
respW := httptest.NewRecorder()
|
||||
|
||||
// Make the request
|
||||
_, err = s.Server.ClientGCRequest(respW, req)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue