mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 03:56:37 +00:00
Migrate away from requests package for Function structs
The function deployment and status structs have been moved away into the faas-provider package. Tested with a build, running tests, and CI. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
8767514527
commit
df97efafae
@ -7,7 +7,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/openfaas/faas/gateway/requests"
|
||||
types "github.com/openfaas/faas-provider/types"
|
||||
)
|
||||
|
||||
type FakePrometheusQueryFetcher struct {
|
||||
@ -45,7 +45,7 @@ func Test_PrometheusMetrics_MixedInto_Services(t *testing.T) {
|
||||
if len(body) == 0 {
|
||||
t.Errorf("Want content-length > 0, got: %d", len(rr.Body.String()))
|
||||
}
|
||||
results := []requests.Function{}
|
||||
results := []types.FunctionStatus{}
|
||||
json.Unmarshal([]byte(rr.Body.String()), &results)
|
||||
if len(results) == 0 {
|
||||
t.Errorf("Want %d function, got: %d", 1, len(results))
|
||||
@ -82,8 +82,8 @@ func Test_FunctionsHandler_ReturnsJSONAndOneFunction(t *testing.T) {
|
||||
|
||||
func makeFunctionsHandler() http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
functions := []requests.Function{
|
||||
requests.Function{
|
||||
functions := []types.FunctionStatus{
|
||||
types.FunctionStatus{
|
||||
Name: "func_echoit",
|
||||
Replicas: 0,
|
||||
},
|
||||
|
Reference in New Issue
Block a user