-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
32 lines (23 loc) · 889 Bytes
/
test.py
File metadata and controls
32 lines (23 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import unittest
import iot_button
class FunctionalTest(unittest.TestCase):
def test_1(self):
event = {"batteryVoltage": "testing", "serialNumber": "testing", "not_a_real_clickType": "LONG"}
context = {"aws_request_id": "foo",
"log_stream_name": "foo",
"invoked_function_arn": "foo",
"client_context": "",
"log_group_name": "foo",
"function_name": "foo",
"function_version": "$LATEST",
"identity": TestingCognitoIdentity(),
"memory_limit_in_mb": "128",
}
self.assertEqual(iot_button.lambda_handler(event, context), 'success')
class TestingCognitoIdentity:
foo = "foo"
bar = "bar"
def some_method(self):
return True
if __name__ == '__main__':
unittest.main()