@@ -79,12 +79,11 @@ def test_global_struct(self):
79
79
fields = [
80
80
Field (
81
81
data_type = DataType (name = "CHAR_STRING" ), code = 1 , name = "astring" , ),
82
- Field (data_type = DataType (name = "CLUSTER_ID" ), code = 2 , name = "idlist" , is_list = True , qualities = set (
83
- [FieldQuality .OPTIONAL ])),
84
- Field (data_type = DataType (name = "int" ), code = 0x123 , name = "valueThatIsNullable" , qualities = set (
85
- [FieldQuality .NULLABLE ])),
82
+ Field (data_type = DataType (name = "CLUSTER_ID" ), code = 2 , name = "idlist" ,
83
+ is_list = True , qualities = FieldQuality .OPTIONAL ),
84
+ Field (data_type = DataType (name = "int" ), code = 0x123 , name = "valueThatIsNullable" , qualities = FieldQuality .NULLABLE ),
86
85
Field (data_type = DataType (name = "char_string" , max_length = 123 ),
87
- code = 222 , name = "sized_string" , qualities = set () ),
86
+ code = 222 , name = "sized_string" ),
88
87
])]
89
88
)
90
89
self .assertEqual (actual , expected )
@@ -100,14 +99,14 @@ def test_fabric_scoped_struct(self):
100
99
101
100
expected = Idl (structs = [
102
101
Struct (name = 'FabricStruct' ,
103
- qualities = { StructQuality .FABRIC_SCOPED } ,
102
+ qualities = StructQuality .FABRIC_SCOPED ,
104
103
fields = [
105
104
Field (
106
105
data_type = DataType (name = "CHAR_STRING" ), code = 1 , name = "astring" , ),
107
- Field (data_type = DataType (name = "CLUSTER_ID" ), code = 2 , name = "idlist" , is_list = True , qualities = set (
108
- [ FieldQuality .OPTIONAL ]) ),
109
- Field (data_type = DataType (name = "int" ), code = 0x123 , name = "nullablesensitive" , qualities = set (
110
- [ FieldQuality .NULLABLE , FieldQuality .FABRIC_SENSITIVE ]) ),
106
+ Field (data_type = DataType (name = "CLUSTER_ID" ), code = 2 , name = "idlist" ,
107
+ is_list = True , qualities = FieldQuality .OPTIONAL ),
108
+ Field (data_type = DataType (name = "int" ), code = 0x123 , name = "nullablesensitive" ,
109
+ qualities = FieldQuality .NULLABLE | FieldQuality .FABRIC_SENSITIVE ),
111
110
])]
112
111
)
113
112
self .assertEqual (actual , expected )
@@ -127,14 +126,14 @@ def test_cluster_attribute(self):
127
126
name = "MyCluster" ,
128
127
code = 0x321 ,
129
128
attributes = [
130
- Attribute (qualities = set ([ AttributeQuality .READABLE ]) , definition = Field (
129
+ Attribute (qualities = AttributeQuality .READABLE , definition = Field (
131
130
data_type = DataType (name = "int8u" ), code = 1 , name = "roAttr" )),
132
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
131
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
133
132
data_type = DataType (name = "int32u" ), code = 123 , name = "rwAttr" , is_list = True )),
134
- Attribute (qualities = set ([ AttributeQuality .NOSUBSCRIBE , AttributeQuality .READABLE ]) , definition = Field (
133
+ Attribute (qualities = AttributeQuality .NOSUBSCRIBE | AttributeQuality .READABLE , definition = Field (
135
134
data_type = DataType (name = "int8s" ), code = 0xAA , name = "nosub" , is_list = True )),
136
- Attribute (qualities = set ([ AttributeQuality .READABLE ]) , definition = Field (
137
- data_type = DataType (name = "int8s" ), code = 0xAB , name = "isNullable" , qualities = set ([ FieldQuality .NULLABLE ]) )),
135
+ Attribute (qualities = AttributeQuality .READABLE , definition = Field (
136
+ data_type = DataType (name = "int8s" ), code = 0xAB , name = "isNullable" , qualities = FieldQuality .NULLABLE )),
138
137
]
139
138
)])
140
139
self .assertEqual (actual , expected )
@@ -152,9 +151,9 @@ def test_sized_attribute(self):
152
151
name = "MyCluster" ,
153
152
code = 1 ,
154
153
attributes = [
155
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
154
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
156
155
data_type = DataType (name = "char_string" , max_length = 11 ), code = 1 , name = "attr1" )),
157
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
156
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
158
157
data_type = DataType (name = "octet_string" , max_length = 33 ), code = 2 , name = "attr2" , is_list = True )),
159
158
]
160
159
)])
@@ -176,25 +175,25 @@ def test_attribute_access(self):
176
175
name = "MyCluster" ,
177
176
code = 1 ,
178
177
attributes = [
179
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
178
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
180
179
data_type = DataType (name = "int8s" ), code = 1 , name = "attr1" ),
181
180
readacl = AccessPrivilege .VIEW ,
182
181
writeacl = AccessPrivilege .OPERATE
183
182
),
184
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
183
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
185
184
data_type = DataType (name = "int8s" ), code = 2 , name = "attr2" ),
186
185
readacl = AccessPrivilege .VIEW ,
187
186
writeacl = AccessPrivilege .OPERATE
188
187
),
189
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
188
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
190
189
data_type = DataType (name = "int8s" ), code = 3 , name = "attr3" ),
191
190
readacl = AccessPrivilege .MANAGE
192
191
),
193
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
192
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
194
193
data_type = DataType (name = "int8s" ), code = 4 , name = "attr4" ),
195
194
writeacl = AccessPrivilege .ADMINISTER
196
195
),
197
- Attribute (qualities = set ([ AttributeQuality .READABLE , AttributeQuality .WRITABLE ]) , definition = Field (
196
+ Attribute (qualities = AttributeQuality .READABLE | AttributeQuality .WRITABLE , definition = Field (
198
197
data_type = DataType (name = "int8s" ), code = 5 , name = "attr5" ),
199
198
readacl = AccessPrivilege .OPERATE ,
200
199
writeacl = AccessPrivilege .MANAGE
@@ -234,13 +233,13 @@ def test_cluster_commands(self):
234
233
input_param = "InParam" , output_param = "OutParam" ),
235
234
Command (name = "TimedCommand" , code = 0xab ,
236
235
input_param = "InParam" , output_param = "DefaultSuccess" ,
237
- qualities = set ([ CommandQuality .TIMED_INVOKE ]) ),
236
+ qualities = CommandQuality .TIMED_INVOKE ),
238
237
Command (name = "FabricScopedCommand" , code = 0xac ,
239
238
input_param = "InParam" , output_param = "DefaultSuccess" ,
240
- qualities = set ([ CommandQuality .FABRIC_SCOPED ]) ),
239
+ qualities = CommandQuality .FABRIC_SCOPED ),
241
240
Command (name = "FabricScopedTimedCommand" , code = 0xad ,
242
241
input_param = "InParam" , output_param = "DefaultSuccess" ,
243
- qualities = set ([ CommandQuality .TIMED_INVOKE , CommandQuality .FABRIC_SCOPED ]) ),
242
+ qualities = CommandQuality .TIMED_INVOKE | CommandQuality .FABRIC_SCOPED ),
244
243
],
245
244
)])
246
245
self .assertEqual (actual , expected )
@@ -272,7 +271,7 @@ def test_cluster_command_access(self):
272
271
Command (name = "TimedCommand" , code = 2 ,
273
272
input_param = "InParam" , output_param = "OutParam" ,
274
273
invokeacl = AccessPrivilege .MANAGE ,
275
- qualities = set ([ CommandQuality .TIMED_INVOKE ]) ),
274
+ qualities = CommandQuality .TIMED_INVOKE ),
276
275
Command (name = "OutOnly" , code = 3 ,
277
276
input_param = None , output_param = "OutParam" ,
278
277
invokeacl = AccessPrivilege .ADMINISTER ,
@@ -387,11 +386,11 @@ def test_fabric_sensitive_event(self):
387
386
code = 0x123 ,
388
387
events = [
389
388
Event (priority = EventPriority .INFO , readacl = AccessPrivilege .VIEW ,
390
- name = "Hello" , code = 1 , fields = [], qualities = { EventQuality .FABRIC_SENSITIVE } ),
389
+ name = "Hello" , code = 1 , fields = [], qualities = EventQuality .FABRIC_SENSITIVE ),
391
390
Event (priority = EventPriority .DEBUG , readacl = AccessPrivilege .MANAGE ,
392
- name = "GoodBye" , code = 2 , fields = [], qualities = { EventQuality .FABRIC_SENSITIVE } ),
391
+ name = "GoodBye" , code = 2 , fields = [], qualities = EventQuality .FABRIC_SENSITIVE ),
393
392
Event (priority = EventPriority .DEBUG , readacl = AccessPrivilege .ADMINISTER ,
394
- name = "AdminEvent" , code = 3 , fields = [], qualities = { EventQuality .FABRIC_SENSITIVE } ),
393
+ name = "AdminEvent" , code = 3 , fields = [], qualities = EventQuality .FABRIC_SENSITIVE ),
395
394
])])
396
395
self .assertEqual (actual , expected )
397
396
0 commit comments