Skip to content

Commit

Permalink
Preserve wsk list /_ compatibility to break circular dependence.
Browse files Browse the repository at this point in the history
Remove redundant test.
Fix go integration test.
  • Loading branch information
rabbah committed Jan 10, 2018
1 parent 2275197 commit a491ee2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
6 changes: 4 additions & 2 deletions commands/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ var namespaceGetCmd = &cobra.Command{
var err error
var namespace string = getClientNamespace()

if whiskErr := CheckArgs(args,0,0,"Namespace get",
if (!(len(args) == 1 && args[0] == "/_")) {
if whiskErr := CheckArgs(args, 0, 0, "Namespace get",
wski18n.T("No arguments are required.")); whiskErr != nil {
return whiskErr
return whiskErr
}
}

actions, _, err := Client.Actions.List("", &whisk.ActionListOptions{ Skip: 0, Limit: 0 })
Expand Down
4 changes: 2 additions & 2 deletions tests/src/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func initInvalidArgs() {
Err: tooManyArgsMsg + invalidArg + ". " + noArgsReqMsg,
},
common.InvalidArg {
Cmd: []string{"namespace", "get", "namespace", invalidArg},
Err: tooManyArgsMsg + invalidArg + ". " + optNamespaceMsg,
Cmd: []string{"namespace", "get", invalidArg},
Err: tooManyArgsMsg + invalidArg + ". " + noArgsReqMsg,
},
common.InvalidArg {
Cmd: []string{"package", "create"},
Expand Down
6 changes: 0 additions & 6 deletions tests/src/test/scala/system/basic/WskBasicTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,6 @@ class WskBasicTests extends TestHelpers with WskTestHelpers {
wsk.namespace.get(expectedExitCode = SUCCESS_EXIT)(WskProps()).stdout should include("default")
}

it should "not accept a namespace on 'wsk list' or 'wsk namespace get'" in {
val namespace = "fakeNamespace"
val stderr = wsk.namespace.get(Some(s"/${namespace}"), expectedExitCode = MISUSE_EXIT).stderr
stderr should include(s"No arguments are required.'")
}

behavior of "Wsk Activation CLI"

it should "create a trigger, and fire a trigger to get its individual fields from an activation" in withAssetCleaner(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
(Seq("activation", "result", "activationID", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
(Seq("activation", "poll", "activationID", invalidArg), s"${tooManyArgsMsg}${invalidArg}. ${optNamespaceMsg}"),
(Seq("namespace", "list", invalidArg), s"${tooManyArgsMsg}${invalidArg}. ${noArgsReqMsg}"),
(Seq("namespace", "get", "namespace", invalidArg), s"${tooManyArgsMsg}${invalidArg}. ${optNamespaceMsg}"),
(Seq("namespace", "get", invalidArg), s"${tooManyArgsMsg}${invalidArg}. ${noArgsReqMsg}"),
(Seq("package", "create"), s"${tooFewArgsMsg} ${packageNameReqMsg}"),
(Seq("package", "create", "packageName", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
(Seq("package", "create", "packageName", "--shared", invalidArg), invalidShared),
Expand Down

0 comments on commit a491ee2

Please sign in to comment.