@@ -58,3 +58,49 @@ def test_or(self):
5858 self .assertEqual (composite .capabilities .get (TSC .Permission .Capability .Delete ), TSC .Permission .Mode .Allow )
5959 self .assertEqual (composite .capabilities .get (TSC .Permission .Capability .ViewComments ), TSC .Permission .Mode .Allow )
6060 self .assertEqual (composite .capabilities .get (TSC .Permission .Capability .ExportXml ), TSC .Permission .Mode .Deny )
61+
62+ def test_eq_false (self ):
63+ grantee = ResourceReference ("a" , "user" )
64+ rule1 = TSC .PermissionsRule (
65+ grantee ,
66+ {
67+ TSC .Permission .Capability .ExportData : TSC .Permission .Mode .Allow ,
68+ TSC .Permission .Capability .Delete : TSC .Permission .Mode .Deny ,
69+ TSC .Permission .Capability .ViewComments : TSC .Permission .Mode .Allow ,
70+ TSC .Permission .Capability .ExportXml : TSC .Permission .Mode .Deny ,
71+ },
72+ )
73+ rule2 = TSC .PermissionsRule (
74+ grantee ,
75+ {
76+ TSC .Permission .Capability .ExportData : TSC .Permission .Mode .Allow ,
77+ TSC .Permission .Capability .Delete : TSC .Permission .Mode .Allow ,
78+ TSC .Permission .Capability .ExportXml : TSC .Permission .Mode .Deny ,
79+ },
80+ )
81+
82+ self .assertNotEqual (rule1 , rule2 )
83+
84+ def test_eq_true (self ):
85+ grantee = ResourceReference ("a" , "user" )
86+ rule1 = TSC .PermissionsRule (
87+ grantee ,
88+ {
89+ TSC .Permission .Capability .ExportData : TSC .Permission .Mode .Allow ,
90+ TSC .Permission .Capability .Delete : TSC .Permission .Mode .Deny ,
91+ TSC .Permission .Capability .ViewComments : TSC .Permission .Mode .Allow ,
92+ TSC .Permission .Capability .ExportXml : TSC .Permission .Mode .Deny ,
93+ },
94+ )
95+ rule2 = TSC .PermissionsRule (
96+ grantee ,
97+ {
98+ TSC .Permission .Capability .ExportData : TSC .Permission .Mode .Allow ,
99+ TSC .Permission .Capability .Delete : TSC .Permission .Mode .Deny ,
100+ TSC .Permission .Capability .ViewComments : TSC .Permission .Mode .Allow ,
101+ TSC .Permission .Capability .ExportXml : TSC .Permission .Mode .Deny ,
102+ },
103+ )
104+ self .assertEqual (rule1 , rule2 )
105+
106+
0 commit comments