Remove unnecessary arg parsing from tests
This commit is contained in:
parent
4c6b8486c9
commit
3dae793f70
@ -1,7 +1,6 @@
|
||||
package cmd_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/ian-howell/airshipctl/cmd"
|
||||
@ -9,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func TestRoot(t *testing.T) {
|
||||
cmdTests := []*test.CmdTest {
|
||||
cmdTests := []*test.CmdTest{
|
||||
&test.CmdTest{
|
||||
Name: "default",
|
||||
CmdLine: "",
|
||||
@ -19,7 +18,6 @@ func TestRoot(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Could not create root command: %s", err.Error())
|
||||
}
|
||||
rootCmd.PersistentFlags().Parse(os.Args[1:])
|
||||
for _, tt := range cmdTests {
|
||||
test.RunTest(t, tt, rootCmd)
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package workflow_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
apixv1beta1fake "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake"
|
||||
@ -22,7 +21,6 @@ func TestWorkflowInit(t *testing.T) {
|
||||
workflowRoot := workflow.NewWorkflowCommand(settings)
|
||||
workflowRoot.AddCommand(workflow.NewWorkflowInitCommand(settings))
|
||||
rootCmd.AddCommand(workflowRoot)
|
||||
rootCmd.PersistentFlags().Parse(os.Args[1:])
|
||||
|
||||
argoClient := argofake.NewSimpleClientset()
|
||||
crdClient := apixv1beta1fake.NewSimpleClientset()
|
||||
|
@ -1,7 +1,6 @@
|
||||
package workflow_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@ -23,7 +22,6 @@ func TestWorkflowList(t *testing.T) {
|
||||
workflowRoot := workflow.NewWorkflowCommand(settings)
|
||||
workflowRoot.AddCommand(workflow.NewWorkflowListCommand(settings))
|
||||
rootCmd.AddCommand(workflowRoot)
|
||||
rootCmd.PersistentFlags().Parse(os.Args[1:])
|
||||
|
||||
cmdTests := []WorkflowCmdTest{
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user