Skip to content

Commit 418f9d5

Browse files
authored
Merge pull request #3 from studio3104/change_member_pvivacy
Encapsulate the context variable
2 parents cad94e8 + 354d683 commit 418f9d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pytest_chalice.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ def __init__(self, *args, **kwargs):
2121
self.custom_context = {}
2222
super(InternalLocalGateway, self).__init__(*args, **kwargs)
2323

24+
@property
25+
def custom_context(self):
26+
return self.__custom_context
27+
28+
@custom_context.setter
29+
def custom_context(self, context):
30+
self.__custom_context = context
31+
2432
def _generate_lambda_event(self, *args, **kwargs):
2533
event = super(InternalLocalGateway, self)._generate_lambda_event(*args, **kwargs)
2634
event['requestContext'].update(self.custom_context)
@@ -30,7 +38,7 @@ def _generate_lambda_event(self, *args, **kwargs):
3038
UPPERCASE_PATTERN = re.compile('([A-Z])')
3139

3240

33-
class ResponseHandler:
41+
class ResponseHandler(object):
3442
def __init__(self, values):
3543
self.values = {}
3644

0 commit comments

Comments
 (0)