@@ -90,6 +90,7 @@ def test_missing_source_file(self):
9090 )
9191 raw_payload = response ['Payload' ].read ().decode ('utf-8' )
9292 json_payload = json .loads (raw_payload )
93+ self .assertEqual ('Unhandled' , response ['FunctionError' ])
9394 self .assertIn ('Source file does not exist: missing.[R|r]' , json_payload ['errorMessage' ])
9495 self .assertEqual ('simpleError' , json_payload ['errorType' ])
9596
@@ -101,6 +102,7 @@ def test_missing_function(self):
101102 )
102103 raw_payload = response ['Payload' ].read ().decode ('utf-8' )
103104 json_payload = json .loads (raw_payload )
105+ self .assertEqual ('Unhandled' , response ['FunctionError' ])
104106 self .assertIn ('Function "handler_missing" does not exist' , json_payload ['errorMessage' ])
105107 self .assertEqual ('simpleError' , json_payload ['errorType' ])
106108
@@ -112,6 +114,7 @@ def test_function_as_variable(self):
112114 )
113115 raw_payload = response ['Payload' ].read ().decode ('utf-8' )
114116 json_payload = json .loads (raw_payload )
117+ self .assertEqual ('Unhandled' , response ['FunctionError' ])
115118 self .assertIn ('Function "handler_as_variable" does not exist' , json_payload ['errorMessage' ])
116119 self .assertEqual ('simpleError' , json_payload ['errorType' ])
117120
@@ -121,6 +124,7 @@ def test_missing_argument(self):
121124 response = lambda_client .invoke (FunctionName = get_function_name ("ExampleFunction" ))
122125 raw_payload = response ['Payload' ].read ().decode ('utf-8' )
123126 json_payload = json .loads (raw_payload )
127+ self .assertEqual ('Unhandled' , response ['FunctionError' ])
124128 self .assertIn ('argument "x" is missing, with no default' , json_payload ['errorMessage' ])
125129 self .assertEqual ('simpleError' , json_payload ['errorType' ])
126130
@@ -132,6 +136,7 @@ def test_unused_argument(self):
132136 )
133137 raw_payload = response ['Payload' ].read ().decode ('utf-8' )
134138 json_payload = json .loads (raw_payload )
139+ self .assertEqual ('Unhandled' , response ['FunctionError' ])
135140 self .assertIn ('unused argument (y = 1)' , json_payload ['errorMessage' ])
136141 self .assertEqual ('simpleError' , json_payload ['errorType' ])
137142
@@ -154,6 +159,7 @@ def test_missing_library(self):
154159 )
155160 raw_payload = response ['Payload' ].read ().decode ('utf-8' )
156161 json_payload = json .loads (raw_payload )
162+ self .assertEqual ('Unhandled' , response ['FunctionError' ])
157163 self .assertIn ('there is no package called ‘Matrix’' , json_payload ['errorMessage' ])
158164 error_type = 'packageNotFoundError' if get_version () == '3_6_0' else 'simpleError'
159165 self .assertEqual (error_type , json_payload ['errorType' ])
0 commit comments