@@ -45,7 +45,7 @@ Python tests located in src/python_testing
4545
4646### A simple test
4747
48- ```
48+ ``` python
4949# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments
5050# for details about the block below.
5151#
@@ -71,18 +71,16 @@ class TC_MYTEST_1_1(MatterBaseTest):
7171 async def test_TC_MYTEST_1_1 (self ):
7272
7373 vendor_name = await self .read_single_attribute_check_success(
74- dev_ctrl=self.default_controller, <span style="color:#38761D"># defaults to
75- self.default_controlller</span>
76- node_id = self.dut_node_id, <span style="color:#38761D"># defaults to
77- self.dut_node_id</span>
74+ dev_ctrl = self .default_controller, # defaults to self.default_controller
75+ node_id = self .dut_node_id, # defaults to self.dut_node_id
7876 cluster = Clusters.BasicInformation,
7977 attribute = Clusters.BasicInformation.Attributes.VendorName,
80- endpoint = 0, <span style="color:#38761D"># defaults to 0</span>
78+ endpoint = 0 , # defaults to 0
8179 )
82- asserts.assert_equal(vendor_name, “ Test vendor name”, “ Unexpected vendor name” )
80+ asserts.assert_equal(vendor_name, " Test vendor name" , " Unexpected vendor name" )
8381
8482if __name__ == " __main__" :
85- default_matter_test_main()
83+ default_matter_test_main()
8684```
8785
8886---
@@ -321,7 +319,7 @@ callbacks are called on update.
321319
322320Example for setting callbacks:
323321
324- ```
322+ ``` python
325323cb = EventSubscriptionHandler(cluster, cluster_id, event_id)
326324
327325urgent = 1
@@ -345,9 +343,9 @@ PyChipError
345343
346344Example:
347345
348- ```
346+ ``` python
349347res = await devCtrl.WriteAttribute(nodeid = 0 , attributes = [(0 ,Clusters.BasicInformation.Attributes.NodeLabel(" Test" ))])
350- asserts.assert_equal(ret[0].status, Status.Success, “ write failed” )
348+ asserts.assert_equal(ret[0 ].status, Status.Success, " write failed" )
351349```
352350
353351### [ SendCommand] ( ./ChipDeviceCtrlAPI.md#sendcommand )
@@ -532,11 +530,11 @@ Note: The name of the pipe can be anything while is a valid file path.
532530
533531Example of usage:
534532
535- ``` bash
536- First run the app with the desired app-pipe path:
533+ ``` shell
534+ # First run the app with the desired app-pipe path:
537535./out/darwin-arm64-all-clusters/chip-all-clusters-app --app-pipe /tmp/ref_alm_2_2
538536
539- Then execute the test with the app-pipe argument with the value defined while running the app.
537+ # Then execute the test with the app-pipe argument with the value defined while running the app.
540538python3 src/python_testing/TC_REFALM_2_2.py --commissioning-method on-network --qr-code MT:-24J0AFN00KA0648G00 --PICS src/app/tests/suites/certification/ci-pics-values --app-pipe /tmp/ref_alm_2_2 --int-arg PIXIT.REFALM.AlarmThreshold:1
541539```
542540
@@ -682,15 +680,15 @@ First ensure the device is in commissioning mode. Then run the test against the
682680device by supplying either the QR code, the manual pairing code or the
683681discriminator / password pair.
684682
685- ` ` `
683+ ``` shell
686684python3 TC_DeviceConformance.py --qr-code MT:-24J0AFN00KA0648G00
687685```
688686
689- ` ` `
687+ ``` shell
690688python3 TC_DeviceConformance.py --manual-code 34970112332
691689```
692690
693- ` ` `
691+ ``` shell
694692python3 TC_DeviceConformance.py --discriminator 3840 --passcode 20202021
695693```
696694
@@ -699,7 +697,7 @@ python3 TC_DeviceConformance.py --discriminator 3840 --passcode 20202021
699697If the device has already been commissioned into the python testing fabric, you
700698can run the test directly
701699
702- ` ` `
700+ ``` shell
703701python3 TC_DeviceConformance.py
704702```
705703
@@ -712,7 +710,7 @@ using the `--commissioning-method` flag and the `--qr-code`, `--manual-code` or
712710
713711For example:
714712
715- ` ` `
713+ ``` shell
716714python3 TC_DeviceConformance.py --discriminator 3840 --passcode 20202021 --commissioning-method on-network
717715```
718716
@@ -736,15 +734,15 @@ the device, they can also be run against a MatterTlvJson machine readable file
736734without requiring the device to be physically present. To run against a
737735previously generated MatterTlvJson device dump file:
738736
739- ` ` `
737+ ``` shell
740738python3 TC_DeviceConformance.py --string-arg test_from_file:device_dump_0xFFF1_0x8001_1.json
741739```
742740
743741You can generate a MatterTlvJson file for a device by leveraging the
744742certification test that generates these (TC-IDM-12.1, implemented in
745743TC_DeviceBasicComposition.py).
746744
747- ` ` `
745+ ``` shell
748746python3 TC_DeviceBasicComposition.py --qr-code MT:-24J0AFN00KA0648G00 --tests test_TC_IDM_12_1
749747```
750748
0 commit comments