File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 28
28
UserMigrationTriggerEvent ,
29
29
VerifyAuthChallengeResponseTriggerEvent ,
30
30
)
31
- from aws_lambda_powertools .utilities .data_classes .common import BaseProxyEvent
31
+ from aws_lambda_powertools .utilities .data_classes .common import BaseProxyEvent , DictWrapper
32
32
from aws_lambda_powertools .utilities .data_classes .dynamo_db_stream_event import (
33
33
AttributeValue ,
34
34
DynamoDBRecordEventName ,
@@ -43,6 +43,21 @@ def load_event(file_name: str) -> dict:
43
43
return json .load (fp )
44
44
45
45
46
+ def test_dict_wrapper_equals ():
47
+ class DataClassSample (DictWrapper ):
48
+ @property
49
+ def message (self ) -> str :
50
+ return self .get ("message" )
51
+
52
+ data1 = {"message" : "foo1" }
53
+ data2 = {"message" : "foo2" }
54
+
55
+ assert DataClassSample (data1 ) == DataClassSample (data1 )
56
+ assert DataClassSample (data1 ) != DataClassSample (data2 )
57
+ assert DataClassSample (data1 ) is not data1
58
+ assert data1 is not DataClassSample (data1 )
59
+
60
+
46
61
def test_cloud_watch_trigger_event ():
47
62
event = CloudWatchLogsEvent (load_event ("cloudWatchLogEvent.json" ))
48
63
You can’t perform that action at this time.
0 commit comments