Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for expectErr (0.08 sec)

  1. internal/config/lambda/event/arn_test.go

    	}
    
    	for i, testCase := range testCases {
    		arn, err := ParseARN(testCase.s)
    		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 *arn != *testCase.expectedARN {
    				t.Fatalf("test %v: data: expected: %v, got: %v", i+1, testCase.expectedARN, arn)
    			}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Mar 07 16:12:41 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  2. internal/event/config_test.go

    		err := ValidateFilterRuleValue(testCase.value)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("test %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    	}
    }
    
    func TestFilterRuleUnmarshalXML(t *testing.T) {
    	testCases := []struct {
    		data           []byte
    		expectedResult *FilterRule
    		expectErr      bool
    	}{
    		{[]byte(`<FilterRule></FilterRule>`), nil, true},
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Dec 05 10:16:33 UTC 2023
    - 29K bytes
    - Viewed (0)
  3. internal/event/targetlist_test.go

    	}
    
    	for i, testCase := range testCases {
    		err := testCase.targetList.Add(testCase.target)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("test %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    			result := testCase.targetList.List()
    
    			if len(result) != len(testCase.expectedResult) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Dec 05 10:16:33 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  4. internal/disk/stat_test.go

    				WriteSectors: 157049224,
    				WriteTicks:   7469810,
    				CurrentIOs:   0,
    				TotalTicks:   7580552,
    				ReqTicks:     9869354,
    			},
    			expectErr: false,
    		},
    		{
    			stat:            "1432553   420084 66247626  2398227",
    			expectedIOStats: IOStats{},
    			expectErr:       true,
    		},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 14 17:11:51 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. internal/config/lambda/event/targetid_test.go

    	}
    
    	for i, testCase := range testCases {
    		data, err := testCase.tid.MarshalJSON()
    		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) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Mar 07 16:12:41 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  6. internal/event/name_test.go

    	}
    
    	for i, testCase := range testCases {
    		data, err := xml.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) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed May 01 01:11:10 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  7. cmd/storage-rest_test.go

    	testCases := []struct {
    		expectErr bool
    	}{
    		{true},
    	}
    
    	for i, testCase := range testCases {
    		_, err := storage.DiskInfo(context.Background(), DiskInfoOptions{Metrics: true})
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("case %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    		if err != errUnformattedDisk {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 22 07:04:48 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  8. internal/bucket/object/lock/lock_test.go

    		value       DefaultRetention
    		expectedErr error
    		expectErr   bool
    	}{
    		{
    			value:       DefaultRetention{Mode: "retain"},
    			expectedErr: fmt.Errorf("unknown retention mode retain"),
    			expectErr:   true,
    		},
    		{
    			value:       DefaultRetention{Mode: RetGovernance},
    			expectedErr: fmt.Errorf("either Days or Years must be specified"),
    			expectErr:   true,
    		},
    		{
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Jun 29 01:20:27 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  9. cmd/policy_test.go

    		expectedResult *miniogopolicy.BucketAccessPolicy
    		expectErr      bool
    	}{
    		{case1Policy, case1Result, false},
    		{case2Policy, case2Result, false},
    		{case3Policy, nil, true},
    	}
    
    	for i, testCase := range testCases {
    		result, err := PolicyToBucketAccessPolicy(testCase.bucketPolicy)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  10. internal/config/identity/openid/jwt_test.go

    		reqURL    string
    		duration  time.Duration
    		expectErr bool
    	}{
    		{
    			reqURL:   "http://127.0.0.1:8443/?Token=xxxxx",
    			duration: time.Duration(60) * time.Minute,
    		},
    		{
    			reqURL:    "http://127.0.0.1:8443/?DurationSeconds=9s",
    			expectErr: true,
    		},
    		{
    			reqURL:    "http://127.0.0.1:8443/?DurationSeconds=31536001",
    			expectErr: true,
    		},
    		{
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 8.3K bytes
    - Viewed (0)
Back to top