Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 323 for testCase (0.19 sec)

  1. cmd/bucket-lifecycle-handlers_test.go

    	},
    ) {
    	for i, testCase := range testCases {
    		// initialize httptest Recorder, this records any mutations to response writer inside the handler.
    		rec := httptest.NewRecorder()
    		// construct HTTP request
    		req, err := newTestSignedRequestV4(testCase.method, getBucketLifecycleURL("", testCase.bucketName),
    			int64(len(testCase.body)), bytes.NewReader(testCase.body), testCase.accessKey, testCase.secretKey, nil)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jun 13 20:52:33 GMT 2023
    - 11.2K bytes
    - Viewed (0)
  2. cmd/signature-v4-utils_test.go

    			if testCase.inputHeaderKey != "" {
    				q.Add(testCase.inputHeaderKey, testCase.inputHeaderValue)
    			}
    			inputReq.URL.RawQuery = q.Encode()
    		} else if testCase.inputHeaderKey != "" {
    			inputReq.Header.Set(testCase.inputHeaderKey, testCase.inputHeaderValue)
    		}
    		inputReq.ParseForm()
    
    		actualResult := skipContentSha256Cksum(inputReq)
    		if testCase.expectedResult != actualResult {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 05 21:26:41 GMT 2024
    - 14.3K bytes
    - Viewed (0)
  3. cmd/utils_test.go

    		},
    	}
    
    	// Validate all test cases.
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			bucketName, objectName := path2BucketObject(testCase.path)
    			if bucketName != testCase.bucket {
    				t.Errorf("failed expected bucket name \"%s\", got \"%s\"", testCase.bucket, bucketName)
    			}
    			if objectName != testCase.object {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Feb 23 21:28:14 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  4. cmd/signature-v4_test.go

    				"Policy": []string{"policy"},
    			},
    			expected: ErrNone,
    		},
    	}
    
    	// Run each test case individually.
    	for i, testCase := range testCases {
    		_, code := doesPolicySignatureMatch(testCase.form)
    		if code != testCase.expected {
    			t.Errorf("(%d) expected to get %s, instead got %s", i, niceError(testCase.expected), niceError(code))
    		}
    	}
    }
    
    func TestDoesPresignedSignatureMatch(t *testing.T) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 10.4K bytes
    - Viewed (1)
  5. cmd/bucket-policy-handlers_test.go

    		},
    	}
    	// Iterating over the cases, fetching the policy and validating the response.
    	for i, testCase := range testCases {
    		// expected bucket policy json string.
    		expectedBucketPolicyStr := fmt.Sprintf(testCase.expectedBucketPolicy, testCase.bucketName, testCase.bucketName)
    		// initialize HTTP NewRecorder, this records any mutations to response writer inside the handler.
    		recV4 := httptest.NewRecorder()
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 32.7K bytes
    - Viewed (0)
  6. 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 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  7. cmd/endpoint-ellipses_test.go

    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			gotGCD := getDivisibleSize(testCase.totalSizes)
    			if testCase.result != gotGCD {
    				t.Errorf("Expected %v, got %v", testCase.result, gotGCD)
    			}
    		})
    	}
    }
    
    // Test tests calculating set indexes with ENV override for drive count.
    func TestGetSetIndexesEnvOverride(t *testing.T) {
    	testCases := []struct {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Dec 07 09:33:56 GMT 2023
    - 15.2K bytes
    - Viewed (0)
  8. internal/hash/reader_test.go

    			success:    false,
    		},
    	}
    
    	for i, testCase := range testCases {
    		t.Run(fmt.Sprintf("case-%d", i+1), func(t *testing.T) {
    			_, err := NewReader(context.Background(), testCase.src, testCase.size, testCase.md5hex, testCase.sha256hex, testCase.actualSize)
    			if err != nil && testCase.success {
    				t.Errorf("Test %q: Expected success, but got error %s instead", testCase.desc, err)
    			}
    			if err == nil && !testCase.success {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 18 17:00:54 GMT 2023
    - 10.3K bytes
    - Viewed (0)
  9. cmd/bucket-handlers_test.go

    		},
    	}
    
    	for i, testCase := range testCases {
    		var req *http.Request
    		var actualContent []byte
    
    		// Generate a signed or anonymous request based on the testCase
    		if testCase.accessKey != "" {
    			req, err = newTestSignedRequestV4(http.MethodPost, getDeleteMultipleObjectsURL("", testCase.bucket),
    				int64(len(testCase.objects)), bytes.NewReader(testCase.objects), testCase.accessKey, testCase.secretKey, nil)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 39.5K bytes
    - Viewed (2)
  10. cmd/update_test.go

    		},
    	}
    	for i, testCase := range testCases {
    		if testCase.errStr != "" {
    			got := releaseTimeToReleaseTag(testCase.t)
    			if got != testCase.tag && testCase.errStr == "" {
    				t.Errorf("Test %d: Expected %v but got %v", i+1, testCase.tag, got)
    			}
    		}
    		tagTime, err := releaseTagToReleaseTime(testCase.tag)
    		if err != nil && err.Error() != testCase.errStr {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 03:07:08 GMT 2024
    - 10.7K bytes
    - Viewed (0)
Back to top