Skip to content

Commit cad757d

Browse files
committed
Add another test case
Support array as input param
1 parent 9de7a8d commit cad757d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/src/test/scala/runtime/actionContainers/PythonBasicTests.scala

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ abstract class PythonBasicTests extends BasicActionRunnerTests with WskActorSyst
318318
}
319319
}
320320

321-
it should "support array result" in {
321+
it should "support return array result" in {
322322
withActionContainer() { c =>
323323
val code =
324324
"""
@@ -334,4 +334,21 @@ abstract class PythonBasicTests extends BasicActionRunnerTests with WskActorSyst
334334
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
335335
}
336336
}
337+
338+
it should "support array as input param" in {
339+
withActionContainer() { c =>
340+
val code =
341+
"""
342+
|def main(args):
343+
| return args
344+
""".stripMargin
345+
346+
val (initCode, res) = c.init(initPayload(code))
347+
initCode should be(200)
348+
349+
val (runCode, runRes) = c.runForJsArray(runPayload(JsArray(JsString("a"), JsString("b"))))
350+
runCode should be(200)
351+
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
352+
}
353+
}
337354
}

0 commit comments

Comments
 (0)