Skip to content

Commit 0e4b5db

Browse files
committed
Fix test.
1 parent bb185c6 commit 0e4b5db

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_direct_invocations.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313
import os
1414
from lambda_local.main import run as lambda_run
1515
from lambda_local.main import call as lambda_call
16+
from lambda_local.context import Context
1617

1718

1819
def my_lambda_function(event, context):
1920
print("Hello World from My Lambda Function!")
2021
return 42
2122

23+
2224
def test_function_call_for_pytest():
23-
request = json.dumps({})
24-
(result, error_type) = lambda_call(func=my_lambda_function, event=request, timeout=1)
25+
(result, error_type) = lambda_call(
26+
my_lambda_function, {}, Context(1))
2527

2628
assert error_type is None
2729

@@ -31,7 +33,7 @@ def test_function_call_for_pytest():
3133
def test_check_command_line():
3234
request = json.dumps({})
3335
request_file = 'check_command_line_event.json'
34-
with open (request_file, "w") as f:
36+
with open(request_file, "w") as f:
3537
f.write(request)
3638

3739
args = argparse.Namespace(event=request_file,
@@ -49,4 +51,3 @@ def test_check_command_line():
4951

5052
os.remove(request_file)
5153
assert p.exitcode == 0
52-

0 commit comments

Comments
 (0)