Added two tests

This commit is contained in:
Diptanu Choudhury
2016-12-20 14:27:38 -08:00
parent 9903a8c6df
commit e42ce28ae7

View File

@@ -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)
}
})
}