(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestSetReplicasNonExistentFn(t *testing.T) { |
| 98 | |
| 99 | testServer := httptest.NewServer( |
| 100 | http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { |
| 101 | res.WriteHeader(http.StatusInternalServerError) |
| 102 | })) |
| 103 | defer testServer.Close() |
| 104 | |
| 105 | var injector middleware.AuthInjector |
| 106 | url, _ := url.Parse(testServer.URL + "/") |
| 107 | esq := NewExternalServiceQuery(*url, injector) |
| 108 | |
| 109 | err := esq.SetReplicas("figlet", "", 1) |
| 110 | |
| 111 | expectedErrStr := "error scaling HTTP code 500" |
| 112 | |
| 113 | if !strings.Contains(err.Error(), expectedErrStr) { |
| 114 | t.Logf("Wanted string containing %s, got %s", expectedErrStr, err.Error()) |
| 115 | t.Fail() |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | func TestSetReplicasExistentFn(t *testing.T) { |
| 120 |
nothing calls this directly
no test coverage detected
searching dependent graphs…