Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for wantCode (0.12 sec)

  1. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/writers_test.go

    		statusCode int
    		object     runtime.Object
    
    		wantCode    int
    		wantHeaders http.Header
    		wantBody    []byte
    	}{
    		{
    			name:        "serialize object",
    			out:         smallPayload,
    			req:         &http.Request{Header: http.Header{}, URL: &url.URL{Path: "/path"}},
    			wantCode:    http.StatusOK,
    			wantHeaders: http.Header{"Content-Type": []string{""}},
    			wantBody:    smallPayload,
    		},
    
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  2. pilot/pkg/xds/debug_test.go

    	tests := []struct {
    		name     string
    		wantCode int
    		proxyID  string
    	}{
    		{
    			name:     "dumps most recent proxy with 200",
    			proxyID:  "test.default",
    			wantCode: 200,
    		},
    		{
    			name:     "returns 404 if proxy not found",
    			proxyID:  "not-found",
    			wantCode: 404,
    		},
    		{
    			name:     "returns 400 if no proxyID",
    			proxyID:  "",
    			wantCode: 400,
    		},
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jan 12 18:20:36 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  3. istioctl/cmd/sysexits_test.go

    	analyze.AnalyzerFoundIssuesError{}:                             ExitAnalyzerFoundIssues,
    }
    
    func TestKnownExitStrings(t *testing.T) {
    	for err, wantCode := range KnownErrorCode {
    		if code := GetExitCode(err); code != wantCode {
    			t.Errorf("For %v want %v, but is %v", err, wantCode, code)
    		}
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 15 15:02:17 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  4. src/net/http/httptest/recorder_test.go

    	type checkFunc func(*ResponseRecorder) error
    	check := func(fns ...checkFunc) []checkFunc { return fns }
    
    	hasStatus := func(wantCode int) checkFunc {
    		return func(rec *ResponseRecorder) error {
    			if rec.Code != wantCode {
    				return fmt.Errorf("Status = %d; want %d", rec.Code, wantCode)
    			}
    			return nil
    		}
    	}
    	hasResultStatus := func(want string) checkFunc {
    		return func(rec *ResponseRecorder) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 23:17:38 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  5. tests/integration/security/authz_test.go

    					for _, c := range cases {
    						c := c
    						testName := fmt.Sprintf("%s(%s)/http", c.host, c.allow)
    						t.NewSubTest(testName).Run(func(t framework.TestContext) {
    							wantCode := http.StatusOK
    							if !c.allow {
    								wantCode = http.StatusForbidden
    							}
    
    							opts := echo.CallOptions{
    								Port: echo.Port{
    									Protocol: protocol.HTTP,
    								},
    								HTTP: echo.HTTP{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 08 23:36:51 UTC 2024
    - 50.1K bytes
    - Viewed (0)
  6. src/net/http/httputil/reverseproxy_test.go

    	tests := []struct {
    		name           string
    		wantCode       int
    		errorHandler   func(http.ResponseWriter, *http.Request, error)
    		transport      http.RoundTripper // defaults to failingRoundTripper
    		modifyResponse func(*http.Response) error
    	}{
    		{
    			name:     "default",
    			wantCode: http.StatusBadGateway,
    		},
    		{
    			name:         "errorhandler",
    			wantCode:     http.StatusTeapot,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 54.6K bytes
    - Viewed (0)
  7. src/net/textproto/reader_test.go

    		r := reader(tt.in + "\nFOLLOWING DATA")
    		code, msg, err := r.ReadResponse(tt.inCode)
    		if err != nil {
    			t.Errorf("#%d: ReadResponse: %v", i, err)
    			continue
    		}
    		if code != tt.wantCode {
    			t.Errorf("#%d: code=%d, want %d", i, code, tt.wantCode)
    		}
    		if msg != tt.wantMsg {
    			t.Errorf("#%d: msg=%q, want %q", i, msg, tt.wantMsg)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 05 18:31:56 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  8. src/net/http/fs_test.go

    		}
    		body, err := io.ReadAll(res.Body)
    		res.Body.Close()
    		if err != nil {
    			t.Fatal(err)
    		}
    		wantBody := file
    		if method == MethodHead {
    			wantBody = nil
    		}
    		if !bytes.Equal(body, wantBody) {
    			t.Fatalf("%v: got body %q, want %q", method, body, wantBody)
    		}
    		if got, want := res.Header.Get("Content-Length"), fmt.Sprint(len(file)); got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 49.9K bytes
    - Viewed (0)
  9. src/net/http/transport_test.go

    	c := &Client{Transport: tr}
    
    	testResponse := func(req *Request, name string, wantCode int) {
    		t.Helper()
    		res, err := c.Do(req)
    		if err != nil {
    			t.Fatalf("%s: Do: %v", name, err)
    		}
    		if res.StatusCode != wantCode {
    			t.Fatalf("%s: Response Statuscode=%d; want %d", name, res.StatusCode, wantCode)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 192.6K bytes
    - Viewed (0)
  10. src/io/fs/readdir_test.go

    			Data:    nil,
    			Mode:    os.ModeDir,
    			ModTime: time.Now(),
    			Sys:     &sysValue,
    		},
    	}
    
    	tests := []struct {
    		path     string
    		wantMode FileMode
    		wantDir  bool
    	}{
    		{path: "notadir.txt", wantMode: 0, wantDir: false},
    		{path: "adir", wantMode: os.ModeDir, wantDir: true},
    	}
    
    	for _, test := range tests {
    		test := test
    		t.Run(test.path, func(t *testing.T) {
    			fi, err := Stat(testFs, test.path)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 16:25:41 UTC 2023
    - 2.6K bytes
    - Viewed (0)
Back to top