Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for NewFakeContext (0.3 sec)

  1. istioctl/pkg/workload/workload_test.go

    			expectedException: false,
    			expectedOutput:    customYAML,
    		},
    	}
    
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, c.description), func(t *testing.T) {
    			verifyTestcaseOutput(t, Cmd(cli.NewFakeContext(nil)), c)
    		})
    	}
    }
    
    func verifyTestcaseOutput(t *testing.T, cmd *cobra.Command, c testcase) {
    	t.Helper()
    
    	var out bytes.Buffer
    	cmd.SetArgs(c.args)
    	cmd.SetOut(&out)
    	cmd.SetErr(&out)
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed Mar 27 16:59:05 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  2. operator/cmd/mesh/manifest_shared_test.go

    	return runCommand(args)
    }
    
    // runCommand runs the given command string.
    func runCommand(command string) (string, error) {
    	var out bytes.Buffer
    	rootCmd := GetRootCmd(cli.NewFakeContext(&cli.NewFakeContextOption{
    		Version: "25",
    	}), strings.Split(command, " "))
    	rootCmd.SetOut(&out)
    
    	err := rootCmd.Execute()
    	return out.String(), err
    }
    
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Feb 20 22:39:28 GMT 2024
    - 11.7K bytes
    - Viewed (1)
  3. istioctl/pkg/multicluster/remote_secret_test.go

    				// ClusterName: testCluster,
    				KubeOptions: KubeOptions{
    					Namespace: testNamespace,
    				},
    				Type:       c.secType,
    				SecretName: c.secretName,
    			}
    
    			ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    				IstioNamespace: "istio-system",
    				Objects:        c.objs,
    				Namespace:      testNamespace,
    				Version:        c.k8sMinorVersion,
    			})
    			client, err := ctx.CLIClient()
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Oct 31 14:48:28 GMT 2023
    - 20.6K bytes
    - Viewed (0)
  4. istioctl/pkg/validate/validate_test.go

    			wantError: true, // Since the directory has invalid files
    		},
    	}
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("[%v] %v", i, c.name), func(t *testing.T) {
    			ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    				IstioNamespace: "istio-system",
    			})
    			validateCmd := NewValidateCommand(ctx)
    			validateCmd.SilenceUsage = true
    			validateCmd.SetArgs(c.args)
    
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Jul 25 08:08:36 GMT 2023
    - 21.5K bytes
    - Viewed (0)
  5. istioctl/pkg/describe/describe_test.go

    		}
    	}
    }
    
    func verifyExecAndK8sConfigTestCaseTestOutput(t *testing.T, c execAndK8sConfigTestCase) {
    	t.Helper()
    
    	ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    		Namespace:      c.namespace,
    		IstioNamespace: c.istioNamespace,
    		Results:        c.configDumps,
    	})
    	client, err := ctx.CLIClient()
    	assert.NoError(t, err)
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Thu Mar 28 09:54:01 GMT 2024
    - 30.4K bytes
    - Viewed (0)
Back to top