Skip to content

Instantly share code, notes, and snippets.

@peacing
Last active August 13, 2020 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peacing/1ce365ff5f7050bd04f1914109defe00 to your computer and use it in GitHub Desktop.
Save peacing/1ce365ff5f7050bd04f1914109defe00 to your computer and use it in GitHub Desktop.
import pytest
from lambda_function import *
test_kinesis_event = {
"Records": [
{
"kinesis": {
base64.b64encode(json.dumps({'a': 'dog', 'b': 'cat'}))
}
}]}
test_s3_event = {
"Records": [{
"s3": {
'bucket': {'name': 'test_bucket'},
'object': {
'key': 'example/s3/path/key'
}
}
}]}
test_sqs_event = {
"Records": [{
"body": json.dumps({
"user_id": "B9B3022F98Fjvjs83AB8/80C185D8",
"updated_timstamp": "2020-03-03T00:50:47"
})
}]}
def test_lambda_handler():
try:
response = lambda_handler(event=test_sqs_event, context={})
except Exception as e:
print(e)
assert True == True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment