Skip to content

Commit bb14500

Browse files
committed
Add command line test
1 parent fa1e14f commit bb14500

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_direct_invocations.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,26 @@ def test_check_command_line():
6363

6464
os.remove(request_file)
6565
assert p.exitcode == 0
66+
67+
68+
def test_check_command_line_error():
69+
request = json.dumps({})
70+
request_file = 'check_command_line_event.json'
71+
with open(request_file, "w") as f:
72+
f.write(request)
73+
74+
args = argparse.Namespace(event=request_file,
75+
file='tests/test_direct_invocations.py',
76+
function='my_failing_lambda_function',
77+
timeout=1,
78+
environment_variables='',
79+
library=None,
80+
version_name='',
81+
arn_string=''
82+
)
83+
p = Process(target=lambda_run, args=(args,))
84+
p.start()
85+
p.join()
86+
87+
os.remove(request_file)
88+
assert p.exitcode == 1

0 commit comments

Comments
 (0)