From de9d31bc0dc68b71404d8b9f262360f354dbb92b Mon Sep 17 00:00:00 2001 From: rocky4570fft Date: Fri, 7 Oct 2016 00:41:31 +1000 Subject: [PATCH] attmpt 5 --- moto/awslambda/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py index 0e24330c4..684f1a248 100644 --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -107,11 +107,12 @@ class LambdaFunction(object): def _invoke_lambda(self, code, event={}, context={}): # TO DO: context not yet implemented + mycode = "\n".join([self.code, 'print lambda_handler(%s, %s)' % (event, context)]) + #print "moto_lambda_debug: ", mycode + try: codeOut = StringIO() codeErr = StringIO() - mycode = "\n".join([self.code, 'print lambda_handler(%s, %s)' % (event, context)]) - #print "moto_lambda_debug: ", mycode sys.stdout = codeOut sys.stderr = codeErr exec(mycode)