rabbah commented on a change in pull request #3840: Remove runtime tests, simplify Rest vs CLI test hierarchy, add sniff test for all runtimes URL: https://github.com/apache/incubator-openwhisk/pull/3840#discussion_r200533477
########## File path: tests/src/test/scala/system/basic/WskBasicPythonTests.scala ########## @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package system.basic - -import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -import org.scalatest.Matchers -import scala.concurrent.duration.DurationInt -import spray.json._ -import spray.json.DefaultJsonProtocol.StringJsonFormat -import common.JsHelpers -import common.TestHelpers -import common.TestUtils -import common.WskOperations -import common.WskProps -import common.WskTestHelpers -import common.WhiskProperties - -@RunWith(classOf[JUnitRunner]) -abstract class WskBasicPythonTests extends TestHelpers with WskTestHelpers with Matchers with JsHelpers { - - implicit val wskprops = WskProps() - val wsk: WskOperations - - behavior of "Native Python Action" - - it should "invoke an action and get the result" in withAssetCleaner(wskprops) { (wp, assetHelper) => - val name = "basicInvoke" - assetHelper.withCleaner(wsk.action, name) { (action, _) => - action.create(name, Some(TestUtils.getTestActionFilename("hello.py"))) - } - - withActivation(wsk.activation, wsk.action.invoke(name, Map("name" -> "Prince".toJson))) { - _.response.result.get.toString should include("Prince") - } - } - - it should "invoke an action with a non-default entry point" in withAssetCleaner(wskprops) { (wp, assetHelper) => - val name = "nonDefaultEntryPoint" - assetHelper.withCleaner(wsk.action, name) { (action, _) => - action.create(name, Some(TestUtils.getTestActionFilename("niam.py")), main = Some("niam")) - } - - withActivation(wsk.activation, wsk.action.invoke(name, Map())) { - _.response.result.get.fields.get("greetings") should be(Some(JsString("Hello from a non-standard entrypoint."))) - } - } - - it should "invoke an action from a zip file with a non-default entry point" in withAssetCleaner(wskprops) { - (wp, assetHelper) => - val name = "pythonZipWithNonDefaultEntryPoint" - assetHelper.withCleaner(wsk.action, name) { (action, _) => - action.create( - name, - Some(TestUtils.getTestActionFilename("python.zip")), - main = Some("niam"), - kind = Some("python:default")) - } - - withActivation(wsk.activation, wsk.action.invoke(name, Map("name" -> "Prince".toJson))) { - _.response.result.get shouldBe JsObject("greeting" -> JsString("Hello Prince!")) - } - } - - Seq("python:2", "python:3").foreach { kind => Review comment: drop, duplicate. ---------------------------------------------------------------- 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
