Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_run_function(self):
self.assertIsNone(LambdaHandler.run_function(no_args, 'e', 'c'))
self.assertEqual(LambdaHandler.run_function(one_arg, 'e', 'c'), 'e')
self.assertEqual(LambdaHandler.run_function(two_args, 'e', 'c'), ('e', 'c'))
self.assertEqual(LambdaHandler.run_function(var_args, 'e', 'c'), ('e', 'c'))
self.assertEqual(LambdaHandler.run_function(var_args_with_one, 'e', 'c'), ('e', 'c'))
try:
LambdaHandler.run_function(unsupported, 'e', 'c')
self.fail('Exception expected')
except RuntimeError as e:
pass
def test_run_function(self):
self.assertIsNone(LambdaHandler.run_function(no_args, 'e', 'c'))
self.assertEqual(LambdaHandler.run_function(one_arg, 'e', 'c'), 'e')
self.assertEqual(LambdaHandler.run_function(two_args, 'e', 'c'), ('e', 'c'))
self.assertEqual(LambdaHandler.run_function(var_args, 'e', 'c'), ('e', 'c'))
self.assertEqual(LambdaHandler.run_function(var_args_with_one, 'e', 'c'), ('e', 'c'))
try:
LambdaHandler.run_function(unsupported, 'e', 'c')
self.fail('Exception expected')
except RuntimeError as e:
pass
def test_handler(self, session):
# Init will test load_remote_settings
lh = LambdaHandler('test_settings', session=session)
# Annoyingly, this will fail during record, but
# the result will actually be okay to use in playback.
# See: https://github.com/garnaat/placebo/issues/48
self.assertEqual(os.environ['hello'], 'world')
event = {
"body": {},
"headers": {},
"params": {
"parameter_1": "asdf1",
"parameter_2": "asdf2",
},
"method": "GET",
"query": {}
}
def certify_callback(event, context):
"""
Load our LH settings and update our cert.
"""
lh = LambdaHandler()
return lh.update_certificate()