Search Options

Results per page
Sort
Preferred Languages
Advance

Results 181 - 190 of 1,281 for testCases (0.14 sec)

  1. pkg/util/flag/flags_test.go

    )
    
    func TestIPVar(t *testing.T) {
    	defaultIP := "0.0.0.0"
    	testCases := []struct {
    		argc      string
    		expectErr bool
    		expectVal string
    	}{
    
    		{
    			argc:      "blah --ip=1.2.3.4",
    			expectVal: "1.2.3.4",
    		},
    		{
    			argc:      "blah --ip=1.2.3.4a",
    			expectErr: true,
    			expectVal: defaultIP,
    		},
    	}
    	for _, tc := range testCases {
    		fs := pflag.NewFlagSet("blah", pflag.PanicOnError)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 14 10:45:23 UTC 2021
    - 8.8K bytes
    - Viewed (0)
  2. pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel_test.go

    	return InstanceAllocation{
    		Allocated: allocated,
    		Instance: &resourceapi.NamedResourcesInstance{
    			Name:       name,
    			Attributes: attributes,
    		},
    	}
    }
    
    func TestModel(t *testing.T) {
    	testcases := map[string]struct {
    		resources   []*resourceapi.NamedResourcesResources
    		allocations []*resourceapi.NamedResourcesAllocationResult
    
    		expectModel Model
    	}{
    		"empty": {},
    
    		"nil": {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 27 09:27:01 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  3. staging/src/k8s.io/cli-runtime/pkg/genericclioptions/template_flags_test.go

    		t.Fatalf("unexpected error: %v", err)
    	}
    	defer func(tempFile *os.File) {
    		tempFile.Close()
    		os.Remove(tempFile.Name())
    	}(templateFile)
    
    	fmt.Fprintf(templateFile, "{{ .metadata.name }}")
    
    	testCases := []struct {
    		name               string
    		outputFormat       string
    		templateArg        string
    		expectedError      string
    		expectedParseError string
    		expectedOutput     string
    		expectNoMatch      bool
    	}{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 09:47:52 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  4. pkg/quota/v1/evaluator/core/services_test.go

    			},
    		},
    	}
    	for testName, testCase := range testCases {
    		t.Run(testName, func(t *testing.T) {
    			actual, err := evaluator.Usage(testCase.service)
    			if err != nil {
    				t.Errorf("%s unexpected error: %v", testName, err)
    			}
    			if !quota.Equals(testCase.usage, actual) {
    				t.Errorf("%s expected: %v, actual: %v", testName, testCase.usage, actual)
    			}
    		})
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Dec 16 15:48:58 UTC 2021
    - 9.4K bytes
    - Viewed (0)
  5. 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 {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Sep 18 17:00:54 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  6. pkg/registry/core/pod/rest/log_test.go

    		Storage: genericregistry.DryRunnableStorage{Storage: s},
    	}
    	logRest := &LogREST{Store: store, KubeletConn: nil}
    
    	negativeOne := int64(-1)
    	testCases := []*api.PodLogOptions{
    		{SinceSeconds: &negativeOne},
    		{TailLines: &negativeOne},
    	}
    
    	for _, tc := range testCases {
    		_, err := logRest.Get(genericapirequest.NewDefaultContext(), "test", tc)
    		if !errors.IsInvalid(err) {
    			t.Fatalf("Unexpected error: %v", err)
    		}
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics_test.go

    			},
    			expectedScope: "cluster",
    		},
    	}
    
    	for _, test := range testCases {
    		t.Run(test.name, func(t *testing.T) {
    			if CleanScope(test.requestInfo) != test.expectedScope {
    				t.Errorf("failed to clean scope: %v", test.requestInfo)
    			}
    		})
    	}
    }
    
    func TestCleanFieldValidation(t *testing.T) {
    	testCases := []struct {
    		name                    string
    		url                     *url.URL
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 27 07:29:19 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  8. cmd/kubeadm/app/cmd/version_test.go

    	}
    }
    
    func TestRunVersion(t *testing.T) {
    	var buf bytes.Buffer
    	iface := make(map[string]interface{})
    	flagNameOutput := "output"
    	cmd := newCmdVersion(&buf)
    
    	testCases := []struct {
    		name              string
    		flag              string
    		expectedError     bool
    		shouldBeValidYAML bool
    		shouldBeValidJSON bool
    	}{
    		{
    			name: "valid: run without flags",
    		},
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 17 14:40:46 UTC 2021
    - 2.3K bytes
    - Viewed (0)
  9. pkg/util/kernel/version_test.go

    */
    
    package kernel
    
    import (
    	"errors"
    	"testing"
    
    	"github.com/stretchr/testify/assert"
    
    	"k8s.io/apimachinery/pkg/util/version"
    )
    
    func TestGetVersion(t *testing.T) {
    	testCases := []struct {
    		name         string
    		readFileFunc readFileFunc
    		expected     *version.Version
    		err          error
    	}{
    		{
    			name: "valid os-release file",
    			readFileFunc: func(_ string) ([]byte, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 19:24:34 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/api/meta/errors_test.go

    limitations under the License.
    */
    
    package meta
    
    import (
    	"errors"
    	"fmt"
    	"testing"
    
    	"k8s.io/apimachinery/pkg/runtime/schema"
    )
    
    func TestErrorMatching(t *testing.T) {
    	testCases := []struct {
    		name string
    		// input should contain an error that is _not_ empty, otherwise the naive reflectlite.DeepEqual matching of
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 11 22:50:51 UTC 2022
    - 2.4K bytes
    - Viewed (0)
Back to top