@@ -85,7 +85,7 @@ def extract_value_from_string(line):
85
85
# Returns False if the value does not match, True otherwise.
86
86
def validate_value (expected_value , line , value_name ):
87
87
88
- # Extract the integer value from the string
88
+ # Extract the integer value from the string.
89
89
value = extract_value_from_string (line )
90
90
91
91
# If the discovered value does not match the expected value,
@@ -98,7 +98,7 @@ def validate_value(expected_value, line, value_name):
98
98
99
99
return False
100
100
101
- # Return True if the value matches the expected value
101
+ # Return True if the value matches the expected value.
102
102
return True
103
103
104
104
@@ -119,46 +119,46 @@ def test_discovery_fn():
119
119
120
120
with open (LINUX_TV_APP_LOGS , 'w' ) as fd1 , open (LINUX_TV_CASTING_APP_LOGS , 'w' ) as fd2 :
121
121
122
- # Run the Linux tv-app and write the output to file
122
+ # Run the Linux tv-app and write the output to file.
123
123
tv_app_rel_path = 'out/tv-app/chip-tv-app'
124
124
tv_app_abs_path = os .path .abspath (tv_app_rel_path )
125
125
tv_app_process = subprocess .Popen (tv_app_abs_path , stdout = fd1 , stderr = subprocess .PIPE , text = True )
126
126
127
127
time .sleep (RUN_INTERVAL )
128
128
129
- # Run the Linux tv-casting-app
129
+ # Run the Linux tv-casting-app.
130
130
tv_casting_app_rel_path = 'out/tv-casting-app/chip-tv-casting-app'
131
131
tv_casting_app_abs_path = os .path .abspath (tv_casting_app_rel_path )
132
132
tv_casting_app_process = subprocess .Popen (
133
133
tv_casting_app_abs_path , stdout = subprocess .PIPE , stderr = subprocess .PIPE , text = True )
134
134
135
- # Initialize variables
135
+ # Initialize variables.
136
136
continue_parsing = False
137
137
valid_discovered_commissioner_str = ''
138
138
139
- # Read the output as we get it from the tv-casting-app process
139
+ # Read the output as we get it from the tv-casting-app process.
140
140
for line in tv_casting_app_process .stdout :
141
141
142
- # Write the line to the Linux tv-casting-app log file
142
+ # Write the line to the Linux tv-casting-app log file.
143
143
fd2 .write (line )
144
144
145
- # Fail fast if "No commissioner discovered" string found
145
+ # Fail fast if "No commissioner discovered" string found.
146
146
if "No commissioner discovered" in line :
147
147
148
148
line = line .rstrip ('\n ' )
149
149
logging .error (line )
150
150
handle_discovery_failure ()
151
151
152
- # Look for 'Discovered Commissioner'
152
+ # Look for 'Discovered Commissioner'.
153
153
if "Discovered Commissioner" in line :
154
154
155
155
line = line .rstrip ('\n ' )
156
156
valid_discovered_commissioner_str = line
157
157
158
- # Continue parsing the content that belongs to the "Discovered Commissioner"
158
+ # Continue parsing the content that belongs to the "Discovered Commissioner".
159
159
continue_parsing = True
160
160
161
- # Initialize variables to store the information of interest
161
+ # Initialize variables to store the information of interest.
162
162
valid_vendor_id = False
163
163
valid_product_id = False
164
164
valid_device_type = False
@@ -169,7 +169,7 @@ def test_discovery_fn():
169
169
170
170
if continue_parsing :
171
171
172
- # Check if the Vendor ID, Product ID, and Device Type match the expected values
172
+ # Check if the Vendor ID, Product ID, and Device Type match the expected values.
173
173
if "Vendor ID:" in line :
174
174
175
175
# If the value of the Vendor ID does not match the expected value, then
0 commit comments