remove unnecessary factory delegation for RESTClientGetter method

This commit is contained in:
David Eads
2018-05-24 09:33:36 -04:00
committed by Maciej Szulik
parent 4da73a5f3d
commit c85e69aeb9
89 changed files with 228 additions and 360 deletions

View File

@@ -34,10 +34,9 @@ import (
func TestCreateRole(t *testing.T) {
roleName := "my-role"
tf := cmdtesting.NewTestFactory()
tf := cmdtesting.NewTestFactory().WithNamespace("test")
defer tf.Cleanup()
tf.Namespace = "test"
tf.Client = &fake.RESTClient{}
tf.ClientConfigVal = defaultClientConfig()
@@ -152,11 +151,9 @@ func TestCreateRole(t *testing.T) {
}
func TestValidate(t *testing.T) {
tf := cmdtesting.NewTestFactory()
tf := cmdtesting.NewTestFactory().WithNamespace("test")
defer tf.Cleanup()
tf.Namespace = "test"
tests := map[string]struct {
roleOptions *CreateRoleOptions
expectErr bool
@@ -357,10 +354,9 @@ func TestValidate(t *testing.T) {
func TestComplete(t *testing.T) {
roleName := "my-role"
tf := cmdtesting.NewTestFactory()
tf := cmdtesting.NewTestFactory().WithNamespace("test")
defer tf.Cleanup()
tf.Namespace = "test"
tf.Client = &fake.RESTClient{}
tf.ClientConfigVal = defaultClientConfig()