@@ -272,7 +272,8 @@ def test_build_xml_override(self):
272
272
asserts .assert_equal (set (in_progress .keys ())- set (tot_xml_clusters .keys ()),
273
273
set (), "There are some in_progress clusters that are not included in the TOT spec" )
274
274
275
- str_path = str (os .path .join (os .path .dirname (os .path .realpath (__file__ )), '..' , '..' , 'data_model' , 'master' , 'clusters' ))
275
+ str_path = str (os .path .join (os .path .dirname (os .path .realpath (__file__ )),
276
+ '..' , '..' , 'data_model' , 'in_progress' , 'clusters' ))
276
277
string_override_check , problems = build_xml_clusters (str_path )
277
278
asserts .assert_equal (string_override_check .keys (), self .spec_xml_clusters .keys (), "Mismatched cluster generation" )
278
279
@@ -462,6 +463,32 @@ def test_provisional_clusters(self):
462
463
asserts .assert_in (id , clusters .keys (), "Non-provisional cluster not parsed" )
463
464
asserts .assert_false (clusters [id ].is_provisional , "Non-provisional cluster marked as provisional" )
464
465
466
+ def test_atomic_thermostat (self ):
467
+ tot_xml_clusters , problems = build_xml_clusters (PrebuiltDataModelDirectory .kMaster )
468
+ one_three_clusters , problems = build_xml_clusters (PrebuiltDataModelDirectory .k1_3 )
469
+ in_progress , problems = build_xml_clusters (PrebuiltDataModelDirectory .kInProgress )
470
+
471
+ asserts .assert_in ("Atomic Request" , tot_xml_clusters [Clusters .Thermostat .id ].command_map ,
472
+ "Atomic request not found on thermostat command map" )
473
+ request_id = tot_xml_clusters [Clusters .Thermostat .id ].command_map ["Atomic Request" ]
474
+ asserts .assert_in (request_id , tot_xml_clusters [Clusters .Thermostat .id ].accepted_commands .keys (),
475
+ "Atomic request not found in thermostat accepted command list" )
476
+
477
+ asserts .assert_in ("Atomic Response" , tot_xml_clusters [Clusters .Thermostat .id ].command_map ,
478
+ "Atomic response not found in the thermostat command map" )
479
+ response_id = tot_xml_clusters [Clusters .Thermostat .id ].command_map ["Atomic Response" ]
480
+ asserts .assert_in (response_id , tot_xml_clusters [Clusters .Thermostat .id ].generated_commands .keys (),
481
+ "Atomic response not found in thermostat generated command list" )
482
+
483
+ asserts .assert_not_in (
484
+ "Atomic Request" , one_three_clusters [Clusters .Thermostat .id ].command_map , "Atomic request found on thermostat command map for 1.3" )
485
+ asserts .assert_not_in (request_id , one_three_clusters [Clusters .Thermostat .id ].accepted_commands .keys (),
486
+ "Atomic request found in thermostat accepted command list for 1.3" )
487
+ asserts .assert_not_in (
488
+ "Atomic Response" , one_three_clusters [Clusters .Thermostat .id ].command_map , "Atomic response found on thermostat command map for 1.3" )
489
+ asserts .assert_not_in (response_id , one_three_clusters [Clusters .Thermostat .id ].generated_commands .keys (),
490
+ "Atomic request found in thermostat generated command list for 1.3" )
491
+
465
492
466
493
if __name__ == "__main__" :
467
494
default_matter_test_main ()
0 commit comments