dubeejw commented on a change in pull request #2424: Allow optional leading 
slash in CLI commands
URL: 
https://github.com/apache/incubator-openwhisk/pull/2424#discussion_r131717176
 
 

 ##########
 File path: tests/src/test/scala/system/basic/WskBasicTests.scala
 ##########
 @@ -75,6 +75,41 @@ class WskBasicTests
             stderr should include(errormsg)
     }
 
+    it should "accept a 3 part Fully Qualified Name without a leading '/'" in {
+        val auth: Seq[String] = Seq("--auth", wskprops.authKey)
+        val guestNamespace = wskprops.namespace
+        val packageName = "packageName3ptFQN"
+        val actionName = "actionName3ptFQN"
+        val triggerName = "triggerName3ptFQN"
+        val ruleName = "ruleName3ptFQN"
+        val fullQualifiedName = 
s"${guestNamespace}/${packageName}/${actionName}"
+        val validArgs: Seq[Seq[String]] = Seq(
+            Seq("package", "create", packageName),
+            Seq("action", "create", fullQualifiedName, defaultAction.get),
+            Seq("action", "update", fullQualifiedName, defaultAction.get),
+            Seq("action", "invoke", fullQualifiedName),
+            Seq("trigger", "create", triggerName),
+            Seq("action", "get", fullQualifiedName),
+            Seq("rule", "create", ruleName, triggerName, fullQualifiedName),
+            Seq("action", "delete", fullQualifiedName)
+        )
+        val cleanUp: Seq[Seq[String]] = Seq(
+            Seq("package", "delete", packageName),
+            Seq("trigger", "delete", triggerName),
+            Seq("rule", "delete", ruleName)
+        )
+        try {
+            validArgs foreach {
+                cmd => val stderr = wsk.cli(cmd ++ wskprops.overrides ++ auth, 
expectedExitCode = SUCCESS_EXIT).stderr
+                stderr shouldBe ""
+            }
+        } finally {
+            cleanUp foreach {
+                cmd => wsk.cli(cmd ++ wskprops.overrides ++ auth, 
expectedExitCode = SUCCESS_EXIT)
 
 Review comment:
   Should be `cmd => wsk.cli(cmd ++ wskprops.overrides ++ auth)`
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to