Skip to content
Snippets Groups Projects
Commit 5be176b2 authored by Justin Berstler's avatar Justin Berstler Committed by rodric rabbah
Browse files

Add kafka_python library to the Python action runtime (#1829)

* Add kafka_python library to the Python action runtime

* Update doc and Python package sniff test

Please squash into previous commit
parent 46337725
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ RUN apk add --no-cache \
RUN pip install \
beautifulsoup4==4.5.1 \
httplib2==0.9.2 \
kafka_python==1.3.1 \
lxml==3.6.4 \
python-dateutil==2.5.3 \
requests==2.11.1 \
......
......@@ -210,6 +210,7 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys
|import simplejson as json
|from twisted.internet import protocol, reactor, endpoints
|import socket
|from kafka import BrokerConnection
|
|def main(args):
| socket.setdefaulttimeout(120)
......@@ -218,6 +219,7 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys
| t = parse('2016-02-22 11:59:00 EST')
| r = requests.get('https://openwhisk.ng.bluemix.net/api/v1')
| j = json.dumps({'foo':'bar'}, separators = (',', ':'))
| kafka = BrokerConnection("it works", 9093, None)
|
| return {
| "bs4": str(b.title),
......@@ -225,7 +227,8 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys
| "dateutil": t.strftime("%A"),
| "lxml": etree.Element("root").tag,
| "json": j,
| "request": r.status_code
| "request": r.status_code,
| "kafka_python": kafka.host
| }
""".stripMargin
......@@ -242,7 +245,8 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys
"dateutil" -> "Monday".toJson,
"lxml" -> "root".toJson,
"json" -> JsObject("foo" -> "bar".toJson).compactPrint.toJson,
"request" -> 200.toJson)))
"request" -> 200.toJson,
"kafka_python" -> "it works".toJson)))
}
checkStreams(out, err, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment