Migrate to Go modules

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2021-01-20 12:12:11 +00:00
committed by Alex Ellis
parent 2e2250afe8
commit 7ce266adc0
667 changed files with 211781 additions and 17546 deletions

View File

@ -27,7 +27,6 @@ func TestCreate_ValidRequest(t *testing.T) {
request := types.FunctionDeployment{
Service: "test_resizer",
Image: "functions/resizer",
Network: "func_functions",
EnvProcess: "",
}
@ -51,7 +50,6 @@ func TestCreate_InvalidImage(t *testing.T) {
request := types.FunctionDeployment{
Service: "test_resizer",
Image: "a b c",
Network: "func_functions",
EnvProcess: "",
}
@ -75,34 +73,6 @@ func TestCreate_InvalidImage(t *testing.T) {
}
}
func TestCreate_InvalidNetwork(t *testing.T) {
request := types.FunctionDeployment{
Service: "test_resizer",
Image: "functions/resizer",
Network: "non_existent_network",
EnvProcess: "",
}
body, code, err := createFunction(request)
if err != nil {
t.Log(err)
t.Fail()
}
expectedErrorCode := http.StatusBadRequest
if code != expectedErrorCode {
t.Errorf("Got HTTP code: %d, want %d\n", code, expectedErrorCode)
return
}
expectedErrorSlice := "network non_existent_network not found"
if !strings.Contains(body, expectedErrorSlice) {
t.Errorf("Error message %s does not contain: %s\n", body, expectedErrorSlice)
return
}
}
func TestCreate_InvalidJson(t *testing.T) {
reqBody := `not json`
_, code, err := fireRequest("http://localhost:8080/system/functions", http.MethodPost, reqBody)