Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Rebased from master
Browse files Browse the repository at this point in the history
Signed-off-by: Prafulla Mahindrakar <[email protected]>
  • Loading branch information
pmahindrakar-oss committed Apr 27, 2021
1 parent 86bb1c7 commit 6644f0f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/update/launch_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func UpdateLPSetup() {
ctx = testutils.Ctx
cmdCtx = testutils.CmdCtx
mockClient = testutils.MockClient
mockClient = testutils.MockAdminClient
}

func TestLPUpdate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/update/named_entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func NamedEntitySetup() {
ctx = testutils.Ctx
cmdCtx = testutils.CmdCtx
mockClient = testutils.MockClient
mockClient = testutils.MockAdminClient
}

func TestNamedEntity(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions cmd/update/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package update
import (
"context"
"errors"
"fmt"
"testing"

"github.com/flyteorg/flytectl/clierrors"
"github.com/flyteorg/flytectl/cmd/config"
cmdCore "github.com/flyteorg/flytectl/cmd/core"
"github.com/flyteorg/flytectl/cmd/testutils"
Expand Down Expand Up @@ -95,7 +97,7 @@ func TestArchiveProjectFuncWithError(t *testing.T) {
func TestEmptyProjectInput(t *testing.T) {
setup()
createProjectSetup()
defer tearDownAndVerify(t, "Project not passed\n")
defer tearDownAndVerify(t, "Project not passed\n")
config.GetConfig().Project = ""
modifyProjectFlags(&(projectConfig.ArchiveProject), false, &(projectConfig.ActivateProject), true)
mockClient.OnUpdateProjectMatch(ctx, projectUpdateRequest).Return(nil, nil)
Expand All @@ -107,10 +109,10 @@ func TestEmptyProjectInput(t *testing.T) {
func TestInvalidInput(t *testing.T) {
setup()
createProjectSetup()
defer tearDownAndVerify(t, "Invalid state passed. Specify either activate or archive\n")
modifyProjectFlags(&(projectConfig.ArchiveProject), false, &(projectConfig.ActivateProject), false)
mockClient.OnUpdateProjectMatch(ctx, projectUpdateRequest).Return(nil, nil)
err := updateProjectsFunc(ctx, args, cmdCtx)
assert.NotNil(t, err)
assert.Equal(t, fmt.Errorf(clierrors.ErrInvalidStateUpdate), err)
mockClient.AssertNotCalled(t, "UpdateProject", ctx, projectUpdateRequest)
}
2 changes: 1 addition & 1 deletion cmd/update/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func UpdateTaskSetup() {
ctx = testutils.Ctx
cmdCtx = testutils.CmdCtx
mockClient = testutils.MockClient
mockClient = testutils.MockAdminClient
}

func TestTaskUpdate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/update/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func UpdateWorkflowSetup() {
ctx = testutils.Ctx
cmdCtx = testutils.CmdCtx
mockClient = testutils.MockClient
mockClient = testutils.MockAdminClient
}

func TestWorkflowUpdate(t *testing.T) {
Expand Down

0 comments on commit 6644f0f

Please sign in to comment.