Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 342 for testCases (0.14 sec)

  1. cmd/net_test.go

    		{"http://8.8.8.8:9000", "http://localhost:9000", false, nil},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			sameAddr, err := sameLocalAddrs(testCase.addr1, testCase.addr2)
    			if testCase.expectedErr != nil && err == nil {
    				t.Errorf("should fail but succeeded")
    			}
    			if testCase.expectedErr == nil && err != nil {
    				t.Errorf("should succeed but failed with %v", err)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Apr 19 08:43:09 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  2. internal/event/name_test.go

    	}
    
    	for i, testCase := range testCases {
    		data, err := json.Marshal(testCase.name)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("test %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    			if !reflect.DeepEqual(data, testCase.expectedData) {
    				t.Fatalf("test %v: data: expected: %v, got: %v", i+1, string(testCase.expectedData), string(data))
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 01:11:10 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  3. pkg/proxy/util/utils_test.go

    			port:   12345,
    			expect: "[fd00:1::5]",
    		},
    	}
    
    	for i := range testCases {
    		got := AppendPortIfNeeded(testCases[i].addr, testCases[i].port)
    		if testCases[i].expect != got {
    			t.Errorf("case %s: expected %v, got %v", testCases[i].name, testCases[i].expect, got)
    		}
    	}
    }
    
    func TestMapIPsByIPFamily(t *testing.T) {
    	testCases := []struct {
    		desc            string
    		ipString        []string
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 20 11:57:43 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  4. cmd/storage-rest_test.go

    	}
    
    	result := make([]byte, 100)
    	for i, testCase := range testCases {
    		result = result[testCase.offset:3]
    		_, err := storage.ReadFile(context.Background(), testCase.volumeName, testCase.objectName, testCase.offset, result, nil)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("case %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  5. pkg/kubelet/cm/cpumanager/policy_options_test.go

    			expectedAvailable: false,
    		},
    	}
    	for _, testCase := range testCases {
    		t.Run(testCase.option, func(t *testing.T) {
    			featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, testCase.featureGate, testCase.featureGateEnable)
    			err := CheckPolicyOptionAvailable(testCase.option)
    			isEnabled := (err == nil)
    			if isEnabled != testCase.expectedAvailable {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  6. cmd/auth-handler_test.go

    	}
    
    	// Validates all testcases.
    	for i, testCase := range testCases {
    		s3Error := isReqAuthenticated(ctx, testCase.req, globalSite.Region(), serviceS3)
    		if s3Error != testCase.s3Error {
    			if _, err := io.ReadAll(testCase.req.Body); toAPIErrorCode(ctx, err) != testCase.s3Error {
    				t.Fatalf("Test %d: Unexpected S3 error: want %d - got %d (got after reading request %s)", i, testCase.s3Error, s3Error, toAPIError(ctx, err).Code)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  7. pkg/kubelet/cm/topologymanager/policy_options_test.go

    			expectedAvailable: true,
    		},
    	}
    	for _, testCase := range testCases {
    		t.Run(testCase.option, func(t *testing.T) {
    			featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, testCase.featureGate, testCase.featureGateEnable)
    			err := CheckPolicyOptionAvailable(testCase.option)
    			isEnabled := (err == nil)
    			if isEnabled != testCase.expectedAvailable {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  8. pkg/controller/ttl/ttl_controller_test.go

    			expectedTTL:  300,
    		},
    	}
    
    	for i, testCase := range testCases {
    		ttlController := &Controller{
    			queue:             workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()),
    			nodeCount:         testCase.nodeCount,
    			desiredTTLSeconds: testCase.desiredTTL,
    			boundaryStep:      testCase.boundaryStep,
    		}
    		if testCase.addNode {
    			logger, _ := ktesting.NewTestContext(t)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  9. cmd/erasure-metadata_test.go

    	}
    
    	// Test them.
    	for _, testCase := range testCases {
    		index, offset, err := fi.ObjectToPartOffset(context.Background(), testCase.offset)
    		if err != testCase.expectedErr {
    			t.Fatalf("%+v: expected = %s, got: %s", testCase, testCase.expectedErr, err)
    		}
    		if index != testCase.expectedIndex {
    			t.Fatalf("%+v: index: expected = %d, got: %d", testCase, testCase.expectedIndex, index)
    		}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 17 20:57:37 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  10. cmd/policy_test.go

    		{yourbucketAnonGetObjectActionArgs, false},
    		{yourbucketGetObjectActionArgs, true},
    	}
    
    	for i, testCase := range testCases {
    		result := p.IsAllowed(testCase.args)
    
    		if result != testCase.expectedResult {
    			t.Fatalf("case %v: expected: %v, got: %v\n", i+1, testCase.expectedResult, result)
    		}
    	}
    }
    
    func getReadOnlyStatement(bucketName, prefix string) []miniogopolicy.Statement {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 8.9K bytes
    - Viewed (0)
Back to top