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